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
3fca0d72
Commit
3fca0d72
authored
Aug 27, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iac/imc: use planar sample format
parent
64c312aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
imc.c
libavcodec/imc.c
+11
-15
No files found.
libavcodec/imc.c
View file @
3fca0d72
...
...
@@ -241,7 +241,7 @@ static av_cold int imc_decode_init(AVCodecContext *avctx)
return
ret
;
}
ff_dsputil_init
(
&
q
->
dsp
,
avctx
);
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLT
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLT
P
;
avctx
->
channel_layout
=
avctx
->
channels
==
1
?
AV_CH_LAYOUT_MONO
:
AV_CH_LAYOUT_STEREO
;
...
...
@@ -661,7 +661,7 @@ static void imc_imdct256(IMCContext *q, IMCChannel *chctx, int channels)
int
i
;
float
re
,
im
;
float
*
dst1
=
q
->
out_samples
;
float
*
dst2
=
q
->
out_samples
+
(
COEFFS
-
1
)
*
channels
;
float
*
dst2
=
q
->
out_samples
+
(
COEFFS
-
1
);
/* prerotation */
for
(
i
=
0
;
i
<
COEFFS
/
2
;
i
++
)
{
...
...
@@ -683,8 +683,8 @@ static void imc_imdct256(IMCContext *q, IMCChannel *chctx, int channels)
+
(
q
->
mdct_sine_window
[
i
*
2
]
*
re
);
*
dst2
=
(
q
->
mdct_sine_window
[
i
*
2
]
*
chctx
->
last_fft_im
[
i
])
-
(
q
->
mdct_sine_window
[
COEFFS
-
1
-
i
*
2
]
*
re
);
dst1
+=
channels
*
2
;
dst2
-=
channels
*
2
;
dst1
+=
2
;
dst2
-=
2
;
chctx
->
last_fft_im
[
i
]
=
im
;
}
}
...
...
@@ -785,7 +785,6 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
chctx
->
decoder_reset
=
1
;
if
(
chctx
->
decoder_reset
)
{
memset
(
q
->
out_samples
,
0
,
COEFFS
*
sizeof
(
*
q
->
out_samples
));
for
(
i
=
0
;
i
<
BANDS
;
i
++
)
chctx
->
old_floor
[
i
]
=
1
.
0
;
for
(
i
=
0
;
i
<
COEFFS
;
i
++
)
...
...
@@ -944,7 +943,7 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
}
for
(
i
=
0
;
i
<
avctx
->
channels
;
i
++
)
{
q
->
out_samples
=
(
float
*
)
q
->
frame
.
data
[
0
]
+
i
;
q
->
out_samples
=
(
float
*
)
q
->
frame
.
extended_data
[
i
]
;
q
->
dsp
.
bswap16_buf
(
buf16
,
(
const
uint16_t
*
)
buf
,
IMC_BLOCK_SIZE
/
2
);
...
...
@@ -957,15 +956,8 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
}
if
(
avctx
->
channels
==
2
)
{
float
*
src
=
(
float
*
)
q
->
frame
.
data
[
0
],
t1
,
t2
;
for
(
i
=
0
;
i
<
COEFFS
;
i
++
)
{
t1
=
src
[
0
];
t2
=
src
[
1
];
src
[
0
]
=
t1
+
t2
;
src
[
1
]
=
t1
-
t2
;
src
+=
2
;
}
q
->
dsp
.
butterflies_float
((
float
*
)
q
->
frame
.
extended_data
[
0
],
(
float
*
)
q
->
frame
.
extended_data
[
1
],
COEFFS
);
}
*
got_frame_ptr
=
1
;
...
...
@@ -995,6 +987,8 @@ AVCodec ff_imc_decoder = {
.
decode
=
imc_decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"IMC (Intel Music Coder)"
),
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_FLTP
,
AV_SAMPLE_FMT_NONE
},
};
AVCodec
ff_iac_decoder
=
{
...
...
@@ -1007,4 +1001,6 @@ AVCodec ff_iac_decoder = {
.
decode
=
imc_decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"IAC (Indeo Audio Coder)"
),
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_FLTP
,
AV_SAMPLE_FMT_NONE
},
};
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