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
9b28e583
Commit
9b28e583
authored
Dec 23, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imc/iac: decode directly to the user-provided AVFrame
parent
6fdfdb23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
imc.c
libavcodec/imc.c
+7
-12
No files found.
libavcodec/imc.c
View file @
9b28e583
...
...
@@ -80,8 +80,6 @@ typedef struct IMCChannel {
}
IMCChannel
;
typedef
struct
{
AVFrame
frame
;
IMCChannel
chctx
[
2
];
/** MDCT tables */
...
...
@@ -252,9 +250,6 @@ static av_cold int imc_decode_init(AVCodecContext *avctx)
avctx
->
channel_layout
=
avctx
->
channels
==
1
?
AV_CH_LAYOUT_MONO
:
AV_CH_LAYOUT_STEREO
;
avcodec_get_frame_defaults
(
&
q
->
frame
);
avctx
->
coded_frame
=
&
q
->
frame
;
return
0
;
}
...
...
@@ -929,6 +924,7 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
static
int
imc_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
;
int
ret
,
i
;
...
...
@@ -943,14 +939,14 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
q
->
frame
.
nb_samples
=
COEFFS
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
q
->
frame
))
<
0
)
{
frame
->
nb_samples
=
COEFFS
;
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
for
(
i
=
0
;
i
<
avctx
->
channels
;
i
++
)
{
q
->
out_samples
=
(
float
*
)
q
->
frame
.
extended_data
[
i
];
q
->
out_samples
=
(
float
*
)
frame
->
extended_data
[
i
];
q
->
dsp
.
bswap16_buf
(
buf16
,
(
const
uint16_t
*
)
buf
,
IMC_BLOCK_SIZE
/
2
);
...
...
@@ -963,12 +959,11 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
}
if
(
avctx
->
channels
==
2
)
{
q
->
fdsp
.
butterflies_float
((
float
*
)
q
->
frame
.
extended_data
[
0
],
(
float
*
)
q
->
frame
.
extended_data
[
1
],
COEFFS
);
q
->
fdsp
.
butterflies_float
((
float
*
)
frame
->
extended_data
[
0
],
(
float
*
)
frame
->
extended_data
[
1
],
COEFFS
);
}
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
q
->
frame
;
*
got_frame_ptr
=
1
;
return
IMC_BLOCK_SIZE
*
avctx
->
channels
;
}
...
...
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