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
1a345903
Commit
1a345903
authored
Aug 28, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpc7/8: use planar sample format
parent
3fca0d72
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
14 deletions
+15
-14
mpc.c
libavcodec/mpc.c
+5
-9
mpc.h
libavcodec/mpc.h
+1
-1
mpc7.c
libavcodec/mpc7.c
+4
-2
mpc8.c
libavcodec/mpc8.c
+5
-2
No files found.
libavcodec/mpc.c
View file @
1a345903
...
...
@@ -43,28 +43,24 @@ void ff_mpc_init(void)
/**
* Process decoded Musepack data and produce PCM
*/
static
void
mpc_synth
(
MPCContext
*
c
,
int16_t
*
out
,
int
channels
)
static
void
mpc_synth
(
MPCContext
*
c
,
int16_t
*
*
out
,
int
channels
)
{
int
dither_state
=
0
;
int
i
,
ch
;
OUT_INT
samples
[
MPA_MAX_CHANNELS
*
MPA_FRAME_SIZE
],
*
samples_ptr
;
for
(
ch
=
0
;
ch
<
channels
;
ch
++
){
samples_ptr
=
samples
+
ch
;
for
(
i
=
0
;
i
<
SAMPLES_PER_BAND
;
i
++
)
{
ff_mpa_synth_filter_fixed
(
&
c
->
mpadsp
,
c
->
synth_buf
[
ch
],
&
(
c
->
synth_buf_offset
[
ch
]),
ff_mpa_synth_window_fixed
,
&
dither_state
,
samples_ptr
,
channels
,
out
[
ch
]
+
32
*
i
,
1
,
c
->
sb_samples
[
ch
][
i
]);
samples_ptr
+=
32
*
channels
;
}
}
for
(
i
=
0
;
i
<
MPC_FRAME_SIZE
*
channels
;
i
++
)
*
out
++=
samples
[
i
];
}
void
ff_mpc_dequantize_and_synth
(
MPCContext
*
c
,
int
maxband
,
void
*
data
,
int
channels
)
void
ff_mpc_dequantize_and_synth
(
MPCContext
*
c
,
int
maxband
,
int16_t
**
out
,
int
channels
)
{
int
i
,
j
,
ch
;
Band
*
bands
=
c
->
bands
;
...
...
@@ -100,5 +96,5 @@ void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, void *data, int ch
}
}
mpc_synth
(
c
,
data
,
channels
);
mpc_synth
(
c
,
out
,
channels
);
}
libavcodec/mpc.h
View file @
1a345903
...
...
@@ -73,6 +73,6 @@ typedef struct {
}
MPCContext
;
void
ff_mpc_init
(
void
);
void
ff_mpc_dequantize_and_synth
(
MPCContext
*
c
,
int
maxband
,
void
*
ds
t
,
int
channels
);
void
ff_mpc_dequantize_and_synth
(
MPCContext
*
c
,
int
maxband
,
int16_t
**
ou
t
,
int
channels
);
#endif
/* AVCODEC_MPC_H */
libavcodec/mpc7.c
View file @
1a345903
...
...
@@ -94,7 +94,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
c
->
IS
,
c
->
MSS
,
c
->
gapless
,
c
->
lastframelen
,
c
->
maxbands
);
c
->
frames_to_skip
=
0
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
P
;
avctx
->
channel_layout
=
AV_CH_LAYOUT_STEREO
;
if
(
vlc_initialized
)
return
0
;
...
...
@@ -293,7 +293,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
for
(
ch
=
0
;
ch
<
2
;
ch
++
)
idx_to_quant
(
c
,
&
gb
,
bands
[
i
].
res
[
ch
],
c
->
Q
[
ch
]
+
off
);
ff_mpc_dequantize_and_synth
(
c
,
mb
,
c
->
frame
.
data
[
0
]
,
2
);
ff_mpc_dequantize_and_synth
(
c
,
mb
,
(
int16_t
**
)
c
->
frame
.
extended_data
,
2
);
bits_used
=
get_bits_count
(
&
gb
);
bits_avail
=
buf_size
*
8
;
...
...
@@ -340,4 +340,6 @@ AVCodec ff_mpc7_decoder = {
.
flush
=
mpc7_decode_flush
,
.
capabilities
=
CODEC_CAP_DR1
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Musepack SV7"
),
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_S16P
,
AV_SAMPLE_FMT_NONE
},
};
libavcodec/mpc8.c
View file @
1a345903
...
...
@@ -135,7 +135,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
c
->
MSS
=
get_bits1
(
&
gb
);
c
->
frames
=
1
<<
(
get_bits
(
&
gb
,
3
)
*
2
);
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
P
;
avctx
->
channel_layout
=
(
avctx
->
channels
==
2
)
?
AV_CH_LAYOUT_STEREO
:
AV_CH_LAYOUT_MONO
;
if
(
vlc_initialized
)
return
0
;
...
...
@@ -405,7 +405,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
}
}
ff_mpc_dequantize_and_synth
(
c
,
maxband
-
1
,
c
->
frame
.
data
[
0
],
ff_mpc_dequantize_and_synth
(
c
,
maxband
-
1
,
(
int16_t
**
)
c
->
frame
.
extended_data
,
avctx
->
channels
);
c
->
cur_frame
++
;
...
...
@@ -438,4 +439,6 @@ AVCodec ff_mpc8_decoder = {
.
flush
=
mpc8_decode_flush
,
.
capabilities
=
CODEC_CAP_DR1
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Musepack SV8"
),
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_S16P
,
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