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
51929fd3
Commit
51929fd3
authored
Jan 05, 2004
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify
Originally committed as revision 2668 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
b1b8f9fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
mpeg12.c
libavcodec/mpeg12.c
+12
-18
No files found.
libavcodec/mpeg12.c
View file @
51929fd3
...
...
@@ -1016,14 +1016,11 @@ static inline int get_dmv(MpegEncContext *s)
static
inline
int
get_qscale
(
MpegEncContext
*
s
)
{
int
qscale
=
get_bits
(
&
s
->
gb
,
5
);
if
(
s
->
codec_id
==
CODEC_ID_MPEG2VIDEO
)
{
if
(
s
->
q_scale_type
)
{
return
non_linear_qscale
[
qscale
];
}
else
{
return
qscale
<<
1
;
}
if
(
s
->
q_scale_type
)
{
return
non_linear_qscale
[
qscale
];
}
else
{
return
qscale
<<
1
;
}
return
qscale
;
}
/* motion type (for mpeg2) */
...
...
@@ -1453,7 +1450,7 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s,
}
else
if
(
level
!=
0
)
{
i
+=
run
;
j
=
scantable
[
i
];
level
=
(
level
*
qscale
*
quant_matrix
[
j
])
>>
3
;
level
=
(
level
*
qscale
*
quant_matrix
[
j
])
>>
4
;
level
=
(
level
-
1
)
|
1
;
level
=
(
level
^
SHOW_SBITS
(
re
,
&
s
->
gb
,
1
))
-
SHOW_SBITS
(
re
,
&
s
->
gb
,
1
);
LAST_SKIP_BITS
(
re
,
&
s
->
gb
,
1
);
...
...
@@ -1471,11 +1468,11 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s,
j
=
scantable
[
i
];
if
(
level
<
0
){
level
=
-
level
;
level
=
(
level
*
qscale
*
quant_matrix
[
j
])
>>
3
;
level
=
(
level
*
qscale
*
quant_matrix
[
j
])
>>
4
;
level
=
(
level
-
1
)
|
1
;
level
=
-
level
;
}
else
{
level
=
(
level
*
qscale
*
quant_matrix
[
j
])
>>
3
;
level
=
(
level
*
qscale
*
quant_matrix
[
j
])
>>
4
;
level
=
(
level
-
1
)
|
1
;
}
}
...
...
@@ -1511,7 +1508,7 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
v
=
SHOW_UBITS
(
re
,
&
s
->
gb
,
2
);
if
(
v
&
2
)
{
LAST_SKIP_BITS
(
re
,
&
s
->
gb
,
2
);
level
=
(
3
*
qscale
*
quant_matrix
[
0
])
>>
4
;
level
=
(
3
*
qscale
*
quant_matrix
[
0
])
>>
5
;
level
=
(
level
-
1
)
|
1
;
if
(
v
&
1
)
level
=
-
level
;
...
...
@@ -1529,7 +1526,7 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
}
else
if
(
level
!=
0
)
{
i
+=
run
;
j
=
scantable
[
i
];
level
=
((
level
*
2
+
1
)
*
qscale
*
quant_matrix
[
j
])
>>
4
;
level
=
((
level
*
2
+
1
)
*
qscale
*
quant_matrix
[
j
])
>>
5
;
level
=
(
level
-
1
)
|
1
;
level
=
(
level
^
SHOW_SBITS
(
re
,
&
s
->
gb
,
1
))
-
SHOW_SBITS
(
re
,
&
s
->
gb
,
1
);
LAST_SKIP_BITS
(
re
,
&
s
->
gb
,
1
);
...
...
@@ -1547,11 +1544,11 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
j
=
scantable
[
i
];
if
(
level
<
0
){
level
=
-
level
;
level
=
((
level
*
2
+
1
)
*
qscale
*
quant_matrix
[
j
])
>>
4
;
level
=
((
level
*
2
+
1
)
*
qscale
*
quant_matrix
[
j
])
>>
5
;
level
=
(
level
-
1
)
|
1
;
level
=
-
level
;
}
else
{
level
=
((
level
*
2
+
1
)
*
qscale
*
quant_matrix
[
j
])
>>
4
;
level
=
((
level
*
2
+
1
)
*
qscale
*
quant_matrix
[
j
])
>>
5
;
level
=
(
level
-
1
)
|
1
;
}
}
...
...
@@ -2313,10 +2310,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
if
(
/*s->mb_y<<field_pic == s->mb_height &&*/
!
s
->
first_field
)
{
/* end of image */
if
(
s
->
codec_id
==
CODEC_ID_MPEG2VIDEO
){
s
->
current_picture_ptr
->
qscale_type
=
FF_QSCALE_TYPE_MPEG2
;
}
else
s
->
current_picture_ptr
->
qscale_type
=
FF_QSCALE_TYPE_MPEG1
;
s
->
current_picture_ptr
->
qscale_type
=
FF_QSCALE_TYPE_MPEG2
;
ff_er_frame_end
(
s
);
...
...
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