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
987fe2dc
Commit
987fe2dc
authored
Apr 15, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ac3enc: differentiate between current block and reference block in bit_alloc()
parent
6b2636bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
ac3enc.c
libavcodec/ac3enc.c
+11
-7
No files found.
libavcodec/ac3enc.c
View file @
987fe2dc
...
...
@@ -1010,7 +1010,8 @@ static int bit_alloc(AC3EncodeContext *s, int snr_offset)
reset_block_bap
(
s
);
mantissa_bits
=
0
;
for
(
blk
=
0
;
blk
<
AC3_MAX_BLOCKS
;
blk
++
)
{
AC3Block
*
block
;
AC3Block
*
block
=
&
s
->
blocks
[
blk
];
AC3Block
*
ref_block
;
// initialize grouped mantissa counts. these are set so that they are
// padded to the next whole group size when bits are counted in
// compute_mantissa_size_final
...
...
@@ -1022,14 +1023,17 @@ static int bit_alloc(AC3EncodeContext *s, int snr_offset)
blocks within a frame are the exponent values. We can take
advantage of that by reusing the bit allocation pointers
whenever we reuse exponents. */
block
=
s
->
blocks
[
blk
].
exp_ref_block
[
ch
];
ref_block
=
block
->
exp_ref_block
[
ch
];
if
(
s
->
exp_strategy
[
ch
][
blk
]
!=
EXP_REUSE
)
{
s
->
ac3dsp
.
bit_alloc_calc_bap
(
block
->
mask
[
ch
],
block
->
psd
[
ch
],
0
,
s
->
nb_coefs
[
ch
],
snr_offset
,
s
->
bit_alloc
.
floor
,
ff_ac3_bap_tab
,
block
->
bap
[
ch
]);
s
->
ac3dsp
.
bit_alloc_calc_bap
(
ref_block
->
mask
[
ch
],
ref_block
->
psd
[
ch
],
0
,
s
->
nb_coefs
[
ch
],
snr_offset
,
s
->
bit_alloc
.
floor
,
ff_ac3_bap_tab
,
ref_block
->
bap
[
ch
]);
}
mantissa_bits
+=
s
->
ac3dsp
.
compute_mantissa_size
(
mant_cnt
,
block
->
bap
[
ch
],
s
->
nb_coefs
[
ch
]);
mantissa_bits
+=
s
->
ac3dsp
.
compute_mantissa_size
(
mant_cnt
,
ref_block
->
bap
[
ch
],
s
->
nb_coefs
[
ch
]);
}
mantissa_bits
+=
compute_mantissa_size_final
(
mant_cnt
);
}
...
...
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