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
db27dadc
Commit
db27dadc
authored
Jun 23, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sonic: replace divide() by ROUNDED_DIV()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c329713d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
sonic.c
libavcodec/sonic.c
+1
-9
No files found.
libavcodec/sonic.c
View file @
db27dadc
...
...
@@ -75,14 +75,6 @@ typedef struct SonicContext {
#define BASE_QUANT 0.6
#define RATE_VARIATION 3.0
static
inline
int
divide
(
int
a
,
int
b
)
{
if
(
a
<
0
)
return
-
(
(
-
a
+
b
/
2
)
/
b
);
else
return
(
a
+
b
/
2
)
/
b
;
}
static
inline
int
shift
(
int
a
,
int
b
)
{
return
(
a
+
(
1
<<
(
b
-
1
)))
>>
b
;
...
...
@@ -734,7 +726,7 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
{
if
(
!
s
->
lossless
)
for
(
i
=
0
;
i
<
s
->
block_align
;
i
++
)
s
->
coded_samples
[
ch
][
i
]
=
divide
(
s
->
coded_samples
[
ch
][
i
],
quant
);
s
->
coded_samples
[
ch
][
i
]
=
ROUNDED_DIV
(
s
->
coded_samples
[
ch
][
i
],
quant
);
if
((
ret
=
intlist_write
(
&
pb
,
s
->
coded_samples
[
ch
],
s
->
block_align
,
1
))
<
0
)
return
ret
;
...
...
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