Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
9cacdabd
Commit
9cacdabd
authored
11 years ago
by
Diego Biurrun
Browse files
Options
Downloads
Patches
Plain Diff
jpegls: cosmetics: Drop some unnecessary parentheses
parent
004b81c4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libavcodec/jpegls.c
+4
-4
4 additions, 4 deletions
libavcodec/jpegls.c
libavcodec/jpeglsdec.c
+3
-3
3 additions, 3 deletions
libavcodec/jpeglsdec.c
libavcodec/jpeglsenc.c
+3
-3
3 additions, 3 deletions
libavcodec/jpeglsenc.c
with
10 additions
and
10 deletions
libavcodec/jpegls.c
+
4
−
4
View file @
9cacdabd
...
@@ -31,7 +31,7 @@ void ff_jpegls_init_state(JLSState *state){
...
@@ -31,7 +31,7 @@ void ff_jpegls_init_state(JLSState *state){
int
i
;
int
i
;
state
->
twonear
=
state
->
near
*
2
+
1
;
state
->
twonear
=
state
->
near
*
2
+
1
;
state
->
range
=
(
(
state
->
maxval
+
state
->
twonear
-
1
)
/
state
->
twonear
)
+
1
;
state
->
range
=
(
state
->
maxval
+
state
->
twonear
-
1
)
/
state
->
twonear
+
1
;
// QBPP = ceil(log2(RANGE))
// QBPP = ceil(log2(RANGE))
for
(
state
->
qbpp
=
0
;
(
1
<<
state
->
qbpp
)
<
state
->
range
;
state
->
qbpp
++
);
for
(
state
->
qbpp
=
0
;
(
1
<<
state
->
qbpp
)
<
state
->
range
;
state
->
qbpp
++
);
...
@@ -39,10 +39,10 @@ void ff_jpegls_init_state(JLSState *state){
...
@@ -39,10 +39,10 @@ void ff_jpegls_init_state(JLSState *state){
if
(
state
->
bpp
<
8
)
if
(
state
->
bpp
<
8
)
state
->
limit
=
16
+
2
*
state
->
bpp
-
state
->
qbpp
;
state
->
limit
=
16
+
2
*
state
->
bpp
-
state
->
qbpp
;
else
else
state
->
limit
=
(
4
*
state
->
bpp
)
-
state
->
qbpp
;
state
->
limit
=
4
*
state
->
bpp
-
state
->
qbpp
;
for
(
i
=
0
;
i
<
367
;
i
++
)
{
for
(
i
=
0
;
i
<
367
;
i
++
)
{
state
->
A
[
i
]
=
FFMAX
(
(
state
->
range
+
32
)
>>
6
,
2
);
state
->
A
[
i
]
=
FFMAX
(
state
->
range
+
32
>>
6
,
2
);
state
->
N
[
i
]
=
1
;
state
->
N
[
i
]
=
1
;
}
}
...
@@ -65,7 +65,7 @@ void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all){
...
@@ -65,7 +65,7 @@ void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all){
if
(
s
->
maxval
==
0
||
reset_all
)
s
->
maxval
=
(
1
<<
s
->
bpp
)
-
1
;
if
(
s
->
maxval
==
0
||
reset_all
)
s
->
maxval
=
(
1
<<
s
->
bpp
)
-
1
;
if
(
s
->
maxval
>=
128
){
if
(
s
->
maxval
>=
128
){
factor
=
(
FFMIN
(
s
->
maxval
,
4095
)
+
128
)
>>
8
;
factor
=
FFMIN
(
s
->
maxval
,
4095
)
+
128
>>
8
;
if
(
s
->
T1
==
0
||
reset_all
)
if
(
s
->
T1
==
0
||
reset_all
)
s
->
T1
=
iso_clip
(
factor
*
(
basic_t1
-
2
)
+
2
+
3
*
s
->
near
,
s
->
near
+
1
,
s
->
maxval
);
s
->
T1
=
iso_clip
(
factor
*
(
basic_t1
-
2
)
+
2
+
3
*
s
->
near
,
s
->
near
+
1
,
s
->
maxval
);
...
...
This diff is collapsed.
Click to expand it.
libavcodec/jpeglsdec.c
+
3
−
3
View file @
9cacdabd
...
@@ -98,7 +98,7 @@ static inline int ls_get_code_regular(GetBitContext *gb, JLSState *state, int Q)
...
@@ -98,7 +98,7 @@ static inline int ls_get_code_regular(GetBitContext *gb, JLSState *state, int Q)
/* decode mapped error */
/* decode mapped error */
if
(
ret
&
1
)
if
(
ret
&
1
)
ret
=
-
(
(
ret
+
1
)
>>
1
);
ret
=
-
(
ret
+
1
>>
1
);
else
else
ret
>>=
1
;
ret
>>=
1
;
...
@@ -136,7 +136,7 @@ static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state, int RI
...
@@ -136,7 +136,7 @@ static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state, int RI
ret
+=
RItype
+
map
;
ret
+=
RItype
+
map
;
if
(
ret
&
1
){
if
(
ret
&
1
){
ret
=
map
-
(
(
ret
+
1
)
>>
1
);
ret
=
map
-
(
ret
+
1
>>
1
);
state
->
B
[
Q
]
++
;
state
->
B
[
Q
]
++
;
}
else
{
}
else
{
ret
=
ret
>>
1
;
ret
=
ret
>>
1
;
...
@@ -186,7 +186,7 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
...
@@ -186,7 +186,7 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
x
+=
stride
;
x
+=
stride
;
}
}
/* if EOL reached, we stop decoding */
/* if EOL reached, we stop decoding */
if
(
r
!=
(
1
<<
ff_log2_run
[
state
->
run_index
[
comp
]])
)
if
(
r
!=
1
<<
ff_log2_run
[
state
->
run_index
[
comp
]])
return
;
return
;
if
(
state
->
run_index
[
comp
]
<
31
)
if
(
state
->
run_index
[
comp
]
<
31
)
state
->
run_index
[
comp
]
++
;
state
->
run_index
[
comp
]
++
;
...
...
This diff is collapsed.
Click to expand it.
libavcodec/jpeglsenc.c
+
3
−
3
View file @
9cacdabd
...
@@ -48,7 +48,7 @@ static inline void ls_encode_regular(JLSState *state, PutBitContext *pb, int Q,
...
@@ -48,7 +48,7 @@ static inline void ls_encode_regular(JLSState *state, PutBitContext *pb, int Q,
if
(
err
<
0
)
if
(
err
<
0
)
err
+=
state
->
range
;
err
+=
state
->
range
;
if
(
err
>=
(
(
state
->
range
+
1
)
>>
1
))
{
if
(
err
>=
(
state
->
range
+
1
>>
1
))
{
err
-=
state
->
range
;
err
-=
state
->
range
;
val
=
2
*
FFABS
(
err
)
-
1
-
map
;
val
=
2
*
FFABS
(
err
)
-
1
-
map
;
}
else
}
else
...
@@ -144,7 +144,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
...
@@ -144,7 +144,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
if
(
x
>=
w
)
if
(
x
>=
w
)
return
;
return
;
Rb
=
R
(
last
,
x
);
Rb
=
R
(
last
,
x
);
RItype
=
(
FFABS
(
Ra
-
Rb
)
<=
state
->
near
)
;
RItype
=
FFABS
(
Ra
-
Rb
)
<=
state
->
near
;
pred
=
RItype
?
Ra
:
Rb
;
pred
=
RItype
?
Ra
:
Rb
;
err
=
R
(
cur
,
x
)
-
pred
;
err
=
R
(
cur
,
x
)
-
pred
;
...
@@ -165,7 +165,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
...
@@ -165,7 +165,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
}
}
if
(
err
<
0
)
if
(
err
<
0
)
err
+=
state
->
range
;
err
+=
state
->
range
;
if
(
err
>=
((
state
->
range
+
1
)
>>
1
)
)
if
(
err
>=
state
->
range
+
1
>>
1
)
err
-=
state
->
range
;
err
-=
state
->
range
;
ls_encode_runterm
(
state
,
pb
,
RItype
,
err
,
ff_log2_run
[
state
->
run_index
[
comp
]]);
ls_encode_runterm
(
state
,
pb
,
RItype
,
err
,
ff_log2_run
[
state
->
run_index
[
comp
]]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment