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
8f173ef0
Commit
8f173ef0
authored
Oct 21, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cook: move samples_per_frame from COOKSubpacket to where it is used
parent
7efbba2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
cook.c
libavcodec/cook.c
+5
-6
No files found.
libavcodec/cook.c
View file @
8f173ef0
...
...
@@ -72,7 +72,6 @@ typedef struct {
int
size
;
int
num_channels
;
int
cookversion
;
int
samples_per_frame
;
int
subbands
;
int
js_subband_start
;
int
js_vlc_bits
;
...
...
@@ -1025,7 +1024,6 @@ static void dump_cook_context(COOKContext *q)
PRINT
(
"bit_rate"
,
q
->
avctx
->
bit_rate
);
PRINT
(
"sample_rate"
,
q
->
avctx
->
sample_rate
);
PRINT
(
"samples_per_channel"
,
q
->
subpacket
[
0
].
samples_per_channel
);
PRINT
(
"samples_per_frame"
,
q
->
subpacket
[
0
].
samples_per_frame
);
PRINT
(
"subbands"
,
q
->
subpacket
[
0
].
subbands
);
PRINT
(
"js_subband_start"
,
q
->
subpacket
[
0
].
js_subband_start
);
PRINT
(
"log2_numvector_size"
,
q
->
subpacket
[
0
].
log2_numvector_size
);
...
...
@@ -1047,6 +1045,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
int
extradata_size
=
avctx
->
extradata_size
;
int
s
=
0
;
unsigned
int
channel_mask
=
0
;
int
samples_per_frame
;
int
ret
;
q
->
avctx
=
avctx
;
...
...
@@ -1073,7 +1072,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
Swap to right endianness so we don't need to care later on. */
if
(
extradata_size
>=
8
)
{
q
->
subpacket
[
s
].
cookversion
=
bytestream_get_be32
(
&
edata_ptr
);
q
->
subpacket
[
s
].
samples_per_frame
=
bytestream_get_be16
(
&
edata_ptr
);
samples_per_frame
=
bytestream_get_be16
(
&
edata_ptr
);
q
->
subpacket
[
s
].
subbands
=
bytestream_get_be16
(
&
edata_ptr
);
extradata_size
-=
8
;
}
...
...
@@ -1085,7 +1084,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
}
/* Initialize extradata related variables. */
q
->
subpacket
[
s
].
samples_per_channel
=
q
->
subpacket
[
s
].
samples_per_frame
/
avctx
->
channels
;
q
->
subpacket
[
s
].
samples_per_channel
=
samples_per_frame
/
avctx
->
channels
;
q
->
subpacket
[
s
].
bits_per_subpacket
=
avctx
->
block_align
*
8
;
/* Initialize default data states. */
...
...
@@ -1142,7 +1141,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
q
->
subpacket
[
s
].
js_subband_start
;
q
->
subpacket
[
s
].
joint_stereo
=
1
;
q
->
subpacket
[
s
].
num_channels
=
2
;
q
->
subpacket
[
s
].
samples_per_channel
=
q
->
subpacket
[
s
].
samples_per_frame
>>
1
;
q
->
subpacket
[
s
].
samples_per_channel
=
samples_per_frame
>>
1
;
if
(
q
->
subpacket
[
s
].
samples_per_channel
>
256
)
{
q
->
subpacket
[
s
].
log2_numvector_size
=
6
;
...
...
@@ -1151,7 +1150,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
q
->
subpacket
[
s
].
log2_numvector_size
=
7
;
}
}
else
q
->
subpacket
[
s
].
samples_per_channel
=
q
->
subpacket
[
s
].
samples_per_frame
;
q
->
subpacket
[
s
].
samples_per_channel
=
samples_per_frame
;
break
;
default:
...
...
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