Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
79fb2a1f
Commit
79fb2a1f
authored
12 years ago
by
Justin Ruggles
Browse files
Options
Downloads
Patches
Plain Diff
ra288: decode directly to the user-provided AVFrame
parent
f7e8c87c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/ra288.c
+5
-9
5 additions, 9 deletions
libavcodec/ra288.c
with
5 additions
and
9 deletions
libavcodec/ra288.c
+
5
−
9
View file @
79fb2a1f
...
...
@@ -38,7 +38,6 @@
#define RA288_BLOCKS_PER_FRAME 32
typedef
struct
{
AVFrame
frame
;
AVFloatDSPContext
fdsp
;
DECLARE_ALIGNED
(
32
,
float
,
sp_lpc
)[
FFALIGN
(
36
,
16
)];
///< LPC coefficients for speech data (spec: A)
DECLARE_ALIGNED
(
32
,
float
,
gain_lpc
)[
FFALIGN
(
10
,
16
)];
///< LPC coefficients for gain (spec: GB)
...
...
@@ -70,9 +69,6 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx)
avpriv_float_dsp_init
(
&
ractx
->
fdsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
avcodec_get_frame_defaults
(
&
ractx
->
frame
);
avctx
->
coded_frame
=
&
ractx
->
frame
;
return
0
;
}
...
...
@@ -178,6 +174,7 @@ static void backward_filter(RA288Context *ractx,
static
int
ra288_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_frame_ptr
,
AVPacket
*
avpkt
)
{
AVFrame
*
frame
=
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
float
*
out
;
...
...
@@ -193,12 +190,12 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
}
/* get output buffer */
ractx
->
frame
.
nb_samples
=
RA288_BLOCK_SIZE
*
RA288_BLOCKS_PER_FRAME
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
ractx
->
frame
))
<
0
)
{
frame
->
nb_samples
=
RA288_BLOCK_SIZE
*
RA288_BLOCKS_PER_FRAME
;
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
out
=
(
float
*
)
ractx
->
frame
.
data
[
0
];
out
=
(
float
*
)
frame
->
data
[
0
];
init_get_bits
(
&
gb
,
buf
,
avctx
->
block_align
*
8
);
...
...
@@ -220,8 +217,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
}
}
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
ractx
->
frame
;
*
got_frame_ptr
=
1
;
return
avctx
->
block_align
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment