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
d752509b
Commit
d752509b
authored
Aug 05, 2012
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use log2(x) instead of log(x) / log(2)
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
90540c2d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
avconv.c
avconv.c
+1
-1
avprobe.c
avprobe.c
+1
-1
imc.c
libavcodec/imc.c
+2
-2
snowenc.c
libavcodec/snowenc.c
+1
-1
No files found.
avconv.c
View file @
d752509b
...
...
@@ -820,7 +820,7 @@ static void print_report(int is_last_report, int64_t timer_start)
if
(
qp
>=
0
&&
qp
<
FF_ARRAY_ELEMS
(
qp_histogram
))
qp_histogram
[
qp
]
++
;
for
(
j
=
0
;
j
<
32
;
j
++
)
snprintf
(
buf
+
strlen
(
buf
),
sizeof
(
buf
)
-
strlen
(
buf
),
"%X"
,
(
int
)
lrintf
(
log
(
qp_histogram
[
j
]
+
1
)
/
log
(
2
)));
snprintf
(
buf
+
strlen
(
buf
),
sizeof
(
buf
)
-
strlen
(
buf
),
"%X"
,
(
int
)
lrintf
(
log
2
(
qp_histogram
[
j
]
+
1
)));
}
if
(
enc
->
flags
&
CODEC_FLAG_PSNR
)
{
int
j
;
...
...
avprobe.c
View file @
d752509b
...
...
@@ -468,7 +468,7 @@ static char *value_string(char *buf, int buf_size, double val, const char *unit)
int
index
;
if
(
unit
==
unit_byte_str
&&
use_byte_value_binary_prefix
)
{
index
=
(
int
)
(
log
(
val
)
/
log
(
2
)
)
/
10
;
index
=
(
int
)
log2
(
val
)
/
10
;
index
=
av_clip
(
index
,
0
,
FF_ARRAY_ELEMS
(
binary_unit_prefixes
)
-
1
);
val
/=
pow
(
2
,
index
*
10
);
prefix_string
=
binary_unit_prefixes
[
index
];
...
...
libavcodec/imc.c
View file @
d752509b
...
...
@@ -342,7 +342,7 @@ static void imc_decode_level_coefficients(IMCContext *q, int *levlCoeffBuf,
// maybe some frequency division thingy
flcoeffs1
[
0
]
=
20000
.
0
/
pow
(
2
,
levlCoeffBuf
[
0
]
*
0
.
18945
);
// 0.18945 = log2(10) * 0.05703125
flcoeffs2
[
0
]
=
log
(
flcoeffs1
[
0
])
/
log
(
2
);
flcoeffs2
[
0
]
=
log
2f
(
flcoeffs1
[
0
]
);
tmp
=
flcoeffs1
[
0
];
tmp2
=
flcoeffs2
[
0
];
...
...
@@ -414,7 +414,7 @@ static int bit_allocation(IMCContext *q, IMCChannel *chctx,
highest
=
FFMAX
(
highest
,
chctx
->
flcoeffs1
[
i
]);
for
(
i
=
0
;
i
<
BANDS
-
1
;
i
++
)
chctx
->
flcoeffs4
[
i
]
=
chctx
->
flcoeffs3
[
i
]
-
log
(
chctx
->
flcoeffs5
[
i
])
/
log
(
2
);
chctx
->
flcoeffs4
[
i
]
=
chctx
->
flcoeffs3
[
i
]
-
log
2f
(
chctx
->
flcoeffs5
[
i
]
);
chctx
->
flcoeffs4
[
BANDS
-
1
]
=
limit
;
highest
=
highest
*
0
.
25
;
...
...
libavcodec/snowenc.c
View file @
d752509b
...
...
@@ -1529,7 +1529,7 @@ static void update_last_header_values(SnowContext *s){
}
static
int
qscale2qlog
(
int
qscale
){
return
rint
(
QROOT
*
log
(
qscale
/
(
float
)
FF_QP2LAMBDA
)
/
log
(
2
))
return
rint
(
QROOT
*
log
2
(
qscale
/
(
float
)
FF_QP2LAMBDA
))
+
61
*
QROOT
/
8
;
///< 64 > 60
}
...
...
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