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
0ee50938
Commit
0ee50938
authored
Aug 11, 2001
by
Fabrice Bellard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed mpeg2 qscale decoding
Originally committed as revision 71 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
991ae7b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
mpeg12.c
libavcodec/mpeg12.c
+18
-11
No files found.
libavcodec/mpeg12.c
View file @
0ee50938
...
...
@@ -489,6 +489,22 @@ static inline int get_dmv(MpegEncContext *s)
return
0
;
}
static
inline
int
get_qscale
(
MpegEncContext
*
s
)
{
int
qscale
;
if
(
s
->
mpeg2
)
{
if
(
s
->
q_scale_type
)
{
qscale
=
non_linear_qscale
[
get_bits
(
&
s
->
gb
,
5
)];
}
else
{
qscale
=
get_bits
(
&
s
->
gb
,
5
)
<<
1
;
}
}
else
{
/* for mpeg1, we use the generic unquant code */
qscale
=
get_bits
(
&
s
->
gb
,
5
);
}
return
qscale
;
}
/* motion type (for mpeg2) */
#define MT_FIELD 1
#define MT_FRAME 2
...
...
@@ -594,16 +610,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
}
if
(
mb_type
&
MB_QUANT
)
{
if
(
s
->
mpeg2
)
{
if
(
s
->
q_scale_type
)
{
s
->
qscale
=
non_linear_qscale
[
get_bits
(
&
s
->
gb
,
5
)];
}
else
{
s
->
qscale
=
get_bits
(
&
s
->
gb
,
5
)
<<
1
;
}
}
else
{
/* for mpeg1, we use the generic unquant code */
s
->
qscale
=
get_bits
(
&
s
->
gb
,
5
);
}
s
->
qscale
=
get_qscale
(
s
);
}
if
(
mb_type
&
MB_INTRA
)
{
if
(
s
->
concealment_motion_vectors
)
{
...
...
@@ -1287,7 +1294,7 @@ static int mpeg_decode_slice(AVCodecContext *avctx,
init_get_bits
(
&
s
->
gb
,
buf
,
buf_size
);
s
->
qscale
=
get_
bits
(
&
s
->
gb
,
5
);
s
->
qscale
=
get_
qscale
(
s
);
/* extra slice info */
while
(
get_bits1
(
&
s
->
gb
)
!=
0
)
{
skip_bits
(
&
s
->
gb
,
8
);
...
...
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