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
89fc7e36
Commit
89fc7e36
authored
Jan 13, 2012
by
Baptiste Coudurier
Committed by
Michael Niedermayer
Jan 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alacdec: support 32 bps
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8d95eb67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
alac.c
libavcodec/alac.c
+22
-0
No files found.
libavcodec/alac.c
View file @
89fc7e36
...
...
@@ -351,6 +351,17 @@ static void interleave_stereo_24(int32_t *buffer[MAX_CHANNELS],
}
}
static
void
interleave_stereo_32
(
int32_t
*
buffer
[
MAX_CHANNELS
],
int32_t
*
buffer_out
,
int
numsamples
)
{
int
i
;
for
(
i
=
0
;
i
<
numsamples
;
i
++
)
{
*
buffer_out
++
=
buffer
[
0
][
i
];
*
buffer_out
++
=
buffer
[
1
][
i
];
}
}
static
int
alac_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_frame_ptr
,
AVPacket
*
avpkt
)
{
...
...
@@ -533,6 +544,16 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
outbuffer
[
i
]
=
alac
->
outputsamples_buffer
[
0
][
i
]
<<
8
;
}
break
;
case
32
:
if
(
channels
==
2
)
{
interleave_stereo_32
(
alac
->
outputsamples_buffer
,
(
int32_t
*
)
alac
->
frame
.
data
[
0
],
outputsamples
);
}
else
{
int32_t
*
outbuffer
=
(
int32_t
*
)
alac
->
frame
.
data
[
0
];
for
(
i
=
0
;
i
<
outputsamples
;
i
++
)
outbuffer
[
i
]
=
alac
->
outputsamples_buffer
[
0
][
i
];
}
break
;
}
if
(
input_buffer_size
*
8
-
get_bits_count
(
&
alac
->
gb
)
>
8
)
...
...
@@ -628,6 +649,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
switch
(
alac
->
setinfo_sample_size
)
{
case
16
:
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
break
;
case
32
:
case
24
:
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S32
;
break
;
default
:
av_log_ask_for_sample
(
avctx
,
"Sample depth %d is not supported.
\n
"
,
...
...
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