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
403b1543
Commit
403b1543
authored
Sep 27, 2009
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics: Rename some variables
Originally committed as revision 20044 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
f805d5fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
37 deletions
+33
-37
ac3.c
libavcodec/ac3.c
+33
-37
No files found.
libavcodec/ac3.c
View file @
403b1543
...
...
@@ -127,74 +127,71 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
int16_t
*
mask
)
{
int16_t
excite
[
50
];
/* excitation */
int
b
in
,
k
;
int
b
ndstrt
,
bndend
,
begin
,
end1
,
tmp
;
int
b
and
;
int
b
and_start
,
band_end
,
begin
,
end1
;
int
lowcomp
,
fastleak
,
slowleak
;
/* excitation function */
b
ndst
rt
=
bin_to_band_tab
[
start
];
b
ndend
=
bin_to_band_tab
[
end
-
1
]
+
1
;
b
and_sta
rt
=
bin_to_band_tab
[
start
];
b
and_end
=
bin_to_band_tab
[
end
-
1
]
+
1
;
if
(
b
ndst
rt
==
0
)
{
if
(
b
and_sta
rt
==
0
)
{
lowcomp
=
0
;
lowcomp
=
calc_lowcomp1
(
lowcomp
,
band_psd
[
0
],
band_psd
[
1
],
384
);
excite
[
0
]
=
band_psd
[
0
]
-
fast_gain
-
lowcomp
;
lowcomp
=
calc_lowcomp1
(
lowcomp
,
band_psd
[
1
],
band_psd
[
2
],
384
);
excite
[
1
]
=
band_psd
[
1
]
-
fast_gain
-
lowcomp
;
begin
=
7
;
for
(
b
in
=
2
;
bin
<
7
;
bin
++
)
{
if
(
!
(
is_lfe
&&
b
in
==
6
))
lowcomp
=
calc_lowcomp1
(
lowcomp
,
band_psd
[
b
in
],
band_psd
[
bin
+
1
],
384
);
fastleak
=
band_psd
[
b
in
]
-
fast_gain
;
slowleak
=
band_psd
[
b
in
]
-
s
->
slow_gain
;
excite
[
b
in
]
=
fastleak
-
lowcomp
;
if
(
!
(
is_lfe
&&
b
in
==
6
))
{
if
(
band_psd
[
b
in
]
<=
band_psd
[
bin
+
1
])
{
begin
=
b
in
+
1
;
for
(
b
and
=
2
;
band
<
7
;
band
++
)
{
if
(
!
(
is_lfe
&&
b
and
==
6
))
lowcomp
=
calc_lowcomp1
(
lowcomp
,
band_psd
[
b
and
],
band_psd
[
band
+
1
],
384
);
fastleak
=
band_psd
[
b
and
]
-
fast_gain
;
slowleak
=
band_psd
[
b
and
]
-
s
->
slow_gain
;
excite
[
b
and
]
=
fastleak
-
lowcomp
;
if
(
!
(
is_lfe
&&
b
and
==
6
))
{
if
(
band_psd
[
b
and
]
<=
band_psd
[
band
+
1
])
{
begin
=
b
and
+
1
;
break
;
}
}
}
end1
=
FFMIN
(
bndend
,
22
);
for
(
bin
=
begin
;
bin
<
end1
;
bin
++
)
{
if
(
!
(
is_lfe
&&
bin
==
6
))
lowcomp
=
calc_lowcomp
(
lowcomp
,
band_psd
[
bin
],
band_psd
[
bin
+
1
],
bin
);
fastleak
=
FFMAX
(
fastleak
-
s
->
fast_decay
,
band_psd
[
bin
]
-
fast_gain
);
slowleak
=
FFMAX
(
slowleak
-
s
->
slow_decay
,
band_psd
[
bin
]
-
s
->
slow_gain
);
excite
[
bin
]
=
FFMAX
(
fastleak
-
lowcomp
,
slowleak
);
end1
=
FFMIN
(
band_end
,
22
);
for
(
band
=
begin
;
band
<
end1
;
band
++
)
{
if
(
!
(
is_lfe
&&
band
==
6
))
lowcomp
=
calc_lowcomp
(
lowcomp
,
band_psd
[
band
],
band_psd
[
band
+
1
],
band
);
fastleak
=
FFMAX
(
fastleak
-
s
->
fast_decay
,
band_psd
[
band
]
-
fast_gain
);
slowleak
=
FFMAX
(
slowleak
-
s
->
slow_decay
,
band_psd
[
band
]
-
s
->
slow_gain
);
excite
[
band
]
=
FFMAX
(
fastleak
-
lowcomp
,
slowleak
);
}
begin
=
22
;
}
else
{
/* coupling channel */
begin
=
bndstrt
;
begin
=
band_start
;
fastleak
=
(
s
->
cpl_fast_leak
<<
8
)
+
768
;
slowleak
=
(
s
->
cpl_slow_leak
<<
8
)
+
768
;
}
for
(
b
in
=
begin
;
bin
<
bndend
;
bin
++
)
{
fastleak
=
FFMAX
(
fastleak
-
s
->
fast_decay
,
band_psd
[
b
in
]
-
fast_gain
);
slowleak
=
FFMAX
(
slowleak
-
s
->
slow_decay
,
band_psd
[
b
in
]
-
s
->
slow_gain
);
excite
[
b
in
]
=
FFMAX
(
fastleak
,
slowleak
);
for
(
b
and
=
begin
;
band
<
band_end
;
band
++
)
{
fastleak
=
FFMAX
(
fastleak
-
s
->
fast_decay
,
band_psd
[
b
and
]
-
fast_gain
);
slowleak
=
FFMAX
(
slowleak
-
s
->
slow_decay
,
band_psd
[
b
and
]
-
s
->
slow_gain
);
excite
[
b
and
]
=
FFMAX
(
fastleak
,
slowleak
);
}
/* compute masking curve */
for
(
b
in
=
bndstrt
;
bin
<
bndend
;
bin
++
)
{
tmp
=
s
->
db_per_bit
-
band_psd
[
bin
];
for
(
b
and
=
band_start
;
band
<
band_end
;
band
++
)
{
int
tmp
=
s
->
db_per_bit
-
band_psd
[
band
];
if
(
tmp
>
0
)
{
excite
[
b
in
]
+=
tmp
>>
2
;
excite
[
b
and
]
+=
tmp
>>
2
;
}
mask
[
b
in
]
=
FFMAX
(
ff_ac3_hearing_threshold_tab
[
bin
>>
s
->
sr_shift
][
s
->
sr_code
],
excite
[
bin
]);
mask
[
b
and
]
=
FFMAX
(
ff_ac3_hearing_threshold_tab
[
band
>>
s
->
sr_shift
][
s
->
sr_code
],
excite
[
band
]);
}
/* delta bit allocation */
if
(
dba_mode
==
DBA_REUSE
||
dba_mode
==
DBA_NEW
)
{
int
band
,
seg
,
delta
;
int
i
,
seg
,
delta
;
if
(
dba_nsegs
>=
8
)
return
-
1
;
band
=
0
;
...
...
@@ -207,9 +204,8 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
}
else
{
delta
=
(
dba_values
[
seg
]
-
4
)
<<
7
;
}
for
(
k
=
0
;
k
<
dba_lengths
[
seg
];
k
++
)
{
mask
[
band
]
+=
delta
;
band
++
;
for
(
i
=
0
;
i
<
dba_lengths
[
seg
];
i
++
)
{
mask
[
band
++
]
+=
delta
;
}
}
}
...
...
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