Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
3b7d4338
Commit
3b7d4338
authored
Dec 24, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
twinvq: decode directly to the user-provided AVFrame
parent
ad2104ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
twinvq.c
libavcodec/twinvq.c
+5
-9
No files found.
libavcodec/twinvq.c
View file @
3b7d4338
...
...
@@ -177,7 +177,6 @@ static const ModeTab mode_44_48 = {
typedef
struct
TwinContext
{
AVCodecContext
*
avctx
;
AVFrame
frame
;
AVFloatDSPContext
fdsp
;
FFTContext
mdct_ctx
[
3
];
...
...
@@ -811,6 +810,7 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb,
static
int
twin_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
;
TwinContext
*
tctx
=
avctx
->
priv_data
;
...
...
@@ -832,12 +832,12 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data,
/* get output buffer */
if
(
tctx
->
discarded_packets
>=
2
)
{
tctx
->
frame
.
nb_samples
=
mtab
->
size
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
tctx
->
frame
))
<
0
)
{
frame
->
nb_samples
=
mtab
->
size
;
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
out
=
(
float
**
)
tctx
->
frame
.
extended_data
;
out
=
(
float
**
)
frame
->
extended_data
;
}
init_get_bits
(
&
gb
,
buf
,
buf_size
*
8
);
...
...
@@ -864,7 +864,6 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data,
}
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
tctx
->
frame
;;
return
buf_size
;
}
...
...
@@ -1166,9 +1165,6 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
memset_float
(
tctx
->
bark_hist
[
0
][
0
],
0
.
1
,
FF_ARRAY_ELEMS
(
tctx
->
bark_hist
));
avcodec_get_frame_defaults
(
&
tctx
->
frame
);
avctx
->
coded_frame
=
&
tctx
->
frame
;
return
0
;
}
...
...
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