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
e41ff421
Commit
e41ff421
authored
Nov 26, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg4videodec: move use_intra_dc_vlc from MpegEncContext to Mpeg4DecContext
parent
3d7c8474
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
mpeg4video.h
libavcodec/mpeg4video.h
+1
-0
mpeg4videodec.c
libavcodec/mpeg4videodec.c
+9
-8
mpegvideo.h
libavcodec/mpegvideo.h
+0
-1
No files found.
libavcodec/mpeg4video.h
View file @
e41ff421
...
@@ -83,6 +83,7 @@ typedef struct Mpeg4DecContext {
...
@@ -83,6 +83,7 @@ typedef struct Mpeg4DecContext {
int
new_pred
;
int
new_pred
;
int
enhancement_type
;
int
enhancement_type
;
int
scalability
;
int
scalability
;
int
use_intra_dc_vlc
;
/* bug workarounds */
/* bug workarounds */
int
divx_version
;
int
divx_version
;
...
...
libavcodec/mpeg4videodec.c
View file @
e41ff421
...
@@ -925,9 +925,10 @@ int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx)
...
@@ -925,9 +925,10 @@ int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx)
* Decode a block.
* Decode a block.
* @return <0 if an error occurred
* @return <0 if an error occurred
*/
*/
static
inline
int
mpeg4_decode_block
(
Mpeg
EncContext
*
s
,
int16_t
*
block
,
static
inline
int
mpeg4_decode_block
(
Mpeg
4DecContext
*
ctx
,
int16_t
*
block
,
int
n
,
int
coded
,
int
intra
,
int
rvlc
)
int
n
,
int
coded
,
int
intra
,
int
rvlc
)
{
{
MpegEncContext
*
s
=
&
ctx
->
m
;
int
level
,
i
,
last
,
run
,
qmul
,
qadd
,
dc_pred_dir
;
int
level
,
i
,
last
,
run
,
qmul
,
qadd
,
dc_pred_dir
;
RLTable
*
rl
;
RLTable
*
rl
;
RL_VLC_ELEM
*
rl_vlc
;
RL_VLC_ELEM
*
rl_vlc
;
...
@@ -936,7 +937,7 @@ static inline int mpeg4_decode_block(MpegEncContext *s, int16_t *block,
...
@@ -936,7 +937,7 @@ static inline int mpeg4_decode_block(MpegEncContext *s, int16_t *block,
// Note intra & rvlc should be optimized away if this is inlined
// Note intra & rvlc should be optimized away if this is inlined
if
(
intra
)
{
if
(
intra
)
{
if
(
s
->
use_intra_dc_vlc
)
{
if
(
ctx
->
use_intra_dc_vlc
)
{
/* DC coef */
/* DC coef */
if
(
s
->
partitioned_frame
)
{
if
(
s
->
partitioned_frame
)
{
level
=
s
->
dc_val
[
0
][
s
->
block_index
[
n
]];
level
=
s
->
dc_val
[
0
][
s
->
block_index
[
n
]];
...
@@ -1151,7 +1152,7 @@ static inline int mpeg4_decode_block(MpegEncContext *s, int16_t *block,
...
@@ -1151,7 +1152,7 @@ static inline int mpeg4_decode_block(MpegEncContext *s, int16_t *block,
not_coded:
not_coded:
if
(
intra
)
{
if
(
intra
)
{
if
(
!
s
->
use_intra_dc_vlc
)
{
if
(
!
ctx
->
use_intra_dc_vlc
)
{
block
[
0
]
=
ff_mpeg4_pred_dc
(
s
,
n
,
block
[
0
],
&
dc_pred_dir
,
0
);
block
[
0
]
=
ff_mpeg4_pred_dc
(
s
,
n
,
block
[
0
],
&
dc_pred_dir
,
0
);
i
-=
i
>>
31
;
// if (i == -1) i = 0;
i
-=
i
>>
31
;
// if (i == -1) i = 0;
...
@@ -1178,7 +1179,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
...
@@ -1178,7 +1179,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
mb_type
=
s
->
current_picture
.
mb_type
[
xy
];
mb_type
=
s
->
current_picture
.
mb_type
[
xy
];
cbp
=
s
->
cbp_table
[
xy
];
cbp
=
s
->
cbp_table
[
xy
];
s
->
use_intra_dc_vlc
=
s
->
qscale
<
s
->
intra_dc_threshold
;
ctx
->
use_intra_dc_vlc
=
s
->
qscale
<
s
->
intra_dc_threshold
;
if
(
s
->
current_picture
.
qscale_table
[
xy
]
!=
s
->
qscale
)
if
(
s
->
current_picture
.
qscale_table
[
xy
]
!=
s
->
qscale
)
ff_set_qscale
(
s
,
s
->
current_picture
.
qscale_table
[
xy
]);
ff_set_qscale
(
s
,
s
->
current_picture
.
qscale_table
[
xy
]);
...
@@ -1228,7 +1229,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
...
@@ -1228,7 +1229,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
s
->
dsp
.
clear_blocks
(
s
->
block
[
0
]);
s
->
dsp
.
clear_blocks
(
s
->
block
[
0
]);
/* decode each block */
/* decode each block */
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
if
(
mpeg4_decode_block
(
s
,
block
[
i
],
i
,
cbp
&
32
,
s
->
mb_intra
,
ctx
->
rvlc
)
<
0
)
{
if
(
mpeg4_decode_block
(
ctx
,
block
[
i
],
i
,
cbp
&
32
,
s
->
mb_intra
,
ctx
->
rvlc
)
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"texture corrupted at %d %d %d
\n
"
,
"texture corrupted at %d %d %d
\n
"
,
s
->
mb_x
,
s
->
mb_y
,
s
->
mb_intra
);
s
->
mb_x
,
s
->
mb_y
,
s
->
mb_intra
);
...
@@ -1576,7 +1577,7 @@ intra:
...
@@ -1576,7 +1577,7 @@ intra:
}
}
cbp
=
(
cbpc
&
3
)
|
(
cbpy
<<
2
);
cbp
=
(
cbpc
&
3
)
|
(
cbpy
<<
2
);
s
->
use_intra_dc_vlc
=
s
->
qscale
<
s
->
intra_dc_threshold
;
ctx
->
use_intra_dc_vlc
=
s
->
qscale
<
s
->
intra_dc_threshold
;
if
(
dquant
)
if
(
dquant
)
ff_set_qscale
(
s
,
s
->
qscale
+
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
ff_set_qscale
(
s
,
s
->
qscale
+
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
...
@@ -1587,7 +1588,7 @@ intra:
...
@@ -1587,7 +1588,7 @@ intra:
s
->
dsp
.
clear_blocks
(
s
->
block
[
0
]);
s
->
dsp
.
clear_blocks
(
s
->
block
[
0
]);
/* decode each block */
/* decode each block */
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
if
(
mpeg4_decode_block
(
s
,
block
[
i
],
i
,
cbp
&
32
,
1
,
0
)
<
0
)
if
(
mpeg4_decode_block
(
ctx
,
block
[
i
],
i
,
cbp
&
32
,
1
,
0
)
<
0
)
return
-
1
;
return
-
1
;
cbp
+=
cbp
;
cbp
+=
cbp
;
}
}
...
@@ -1596,7 +1597,7 @@ intra:
...
@@ -1596,7 +1597,7 @@ intra:
/* decode each block */
/* decode each block */
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
if
(
mpeg4_decode_block
(
s
,
block
[
i
],
i
,
cbp
&
32
,
0
,
0
)
<
0
)
if
(
mpeg4_decode_block
(
ctx
,
block
[
i
],
i
,
cbp
&
32
,
0
,
0
)
<
0
)
return
-
1
;
return
-
1
;
cbp
+=
cbp
;
cbp
+=
cbp
;
}
}
...
...
libavcodec/mpegvideo.h
View file @
e41ff421
...
@@ -593,7 +593,6 @@ typedef struct MpegEncContext {
...
@@ -593,7 +593,6 @@ typedef struct MpegEncContext {
int
vo_type
;
int
vo_type
;
int
vol_control_parameters
;
///< does the stream contain the low_delay flag, used to workaround buggy encoders
int
vol_control_parameters
;
///< does the stream contain the low_delay flag, used to workaround buggy encoders
int
intra_dc_threshold
;
///< QP above whch the ac VLC should be used for intra dc
int
intra_dc_threshold
;
///< QP above whch the ac VLC should be used for intra dc
int
use_intra_dc_vlc
;
PutBitContext
tex_pb
;
///< used for data partitioned VOPs
PutBitContext
tex_pb
;
///< used for data partitioned VOPs
PutBitContext
pb2
;
///< used for data partitioned VOPs
PutBitContext
pb2
;
///< used for data partitioned VOPs
int
mpeg_quant
;
int
mpeg_quant
;
...
...
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