Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
3997fef9
Commit
3997fef9
authored
Dec 24, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truespeech: decode directly to the user-provided AVFrame
parent
4a2b26fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
truespeech.c
libavcodec/truespeech.c
+5
-9
No files found.
libavcodec/truespeech.c
View file @
3997fef9
...
...
@@ -36,7 +36,6 @@
* TrueSpeech decoder context
*/
typedef
struct
{
AVFrame
frame
;
DSPContext
dsp
;
/* input data */
DECLARE_ALIGNED
(
16
,
uint8_t
,
buffer
)[
32
];
...
...
@@ -73,9 +72,6 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
ff_dsputil_init
(
&
c
->
dsp
,
avctx
);
avcodec_get_frame_defaults
(
&
c
->
frame
);
avctx
->
coded_frame
=
&
c
->
frame
;
return
0
;
}
...
...
@@ -310,6 +306,7 @@ static void truespeech_save_prevvec(TSContext *c)
static
int
truespeech_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
;
TSContext
*
c
=
avctx
->
priv_data
;
...
...
@@ -327,12 +324,12 @@ static int truespeech_decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
c
->
frame
.
nb_samples
=
iterations
*
240
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
c
->
frame
))
<
0
)
{
frame
->
nb_samples
=
iterations
*
240
;
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
samples
=
(
int16_t
*
)
c
->
frame
.
data
[
0
];
samples
=
(
int16_t
*
)
frame
->
data
[
0
];
memset
(
samples
,
0
,
iterations
*
240
*
sizeof
(
*
samples
));
...
...
@@ -354,8 +351,7 @@ static int truespeech_decode_frame(AVCodecContext *avctx, void *data,
truespeech_save_prevvec
(
c
);
}
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
c
->
frame
;
*
got_frame_ptr
=
1
;
return
buf_size
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment