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
de28e73c
Commit
de28e73c
authored
Apr 27, 2016
by
foo86
Committed by
James Almer
May 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/dcaenc: reuse shared quant levels table
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
9a499e0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
dcaenc.c
libavcodec/dcaenc.c
+4
-4
dcaenc.h
libavcodec/dcaenc.h
+0
-7
No files found.
libavcodec/dcaenc.c
View file @
de28e73c
...
...
@@ -683,7 +683,7 @@ static int calc_one_scale(int32_t peak_cb, int abits, softfloat *quant)
continue
;
our_quant
.
m
=
mul32
(
scalefactor_inv
[
our_nscale
-
try_remove
].
m
,
stepsize_inv
[
abits
].
m
);
our_quant
.
e
=
scalefactor_inv
[
our_nscale
-
try_remove
].
e
+
stepsize_inv
[
abits
].
e
-
17
;
if
((
quant_levels
[
abits
]
-
1
)
/
2
<
quantize_value
(
peak
,
our_quant
))
if
((
ff_dca_
quant_levels
[
abits
]
-
1
)
/
2
<
quantize_value
(
peak
,
our_quant
))
continue
;
our_nscale
-=
try_remove
;
}
...
...
@@ -693,7 +693,7 @@ static int calc_one_scale(int32_t peak_cb, int abits, softfloat *quant)
quant
->
m
=
mul32
(
scalefactor_inv
[
our_nscale
].
m
,
stepsize_inv
[
abits
].
m
);
quant
->
e
=
scalefactor_inv
[
our_nscale
].
e
+
stepsize_inv
[
abits
].
e
-
17
;
av_assert0
((
quant_levels
[
abits
]
-
1
)
/
2
>=
quantize_value
(
peak
,
*
quant
));
av_assert0
((
ff_dca_
quant_levels
[
abits
]
-
1
)
/
2
>=
quantize_value
(
peak
,
*
quant
));
return
our_nscale
;
}
...
...
@@ -858,9 +858,9 @@ static void put_subframe_samples(DCAEncContext *c, int ss, int band, int ch)
for
(
i
=
0
;
i
<
8
;
i
+=
4
)
{
sum
=
0
;
for
(
j
=
3
;
j
>=
0
;
j
--
)
{
sum
*=
quant_levels
[
c
->
abits
[
band
][
ch
]];
sum
*=
ff_dca_
quant_levels
[
c
->
abits
[
band
][
ch
]];
sum
+=
c
->
quantized
[
ss
*
8
+
i
+
j
][
band
][
ch
];
sum
+=
(
quant_levels
[
c
->
abits
[
band
][
ch
]]
-
1
)
/
2
;
sum
+=
(
ff_dca_
quant_levels
[
c
->
abits
[
band
][
ch
]]
-
1
)
/
2
;
}
put_bits
(
&
c
->
pb
,
bit_consumption
[
c
->
abits
[
band
][
ch
]]
/
4
,
sum
);
}
...
...
libavcodec/dcaenc.h
View file @
de28e73c
...
...
@@ -103,11 +103,4 @@ static const int bit_consumption[27] = {
272
,
288
,
304
,
320
,
336
,
352
,
368
,
};
/* Table B.5: Selection of quantization levels and codebooks */
static
const
int
quant_levels
[
27
]
=
{
1
,
3
,
5
,
7
,
9
,
13
,
17
,
25
,
32
,
64
,
128
,
256
,
512
,
1024
,
2048
,
4096
,
8192
,
16384
,
32768
,
65536
,
131072
,
262144
,
524288
,
1048576
,
2097152
,
4194304
,
8388608
,
};
#endif
/* AVCODEC_DCAENC_H */
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