Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
b53569e0
Commit
b53569e0
authored
Jan 29, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264_cabac: remove now unnecessary H264Context function parameters
parent
a12d3188
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
h264_cabac.c
libavcodec/h264_cabac.c
+33
-33
No files found.
libavcodec/h264_cabac.c
View file @
b53569e0
...
@@ -1294,7 +1294,7 @@ static int decode_cabac_field_decoding_flag(const H264Context *h, H264SliceConte
...
@@ -1294,7 +1294,7 @@ static int decode_cabac_field_decoding_flag(const H264Context *h, H264SliceConte
return
get_cabac_noinline
(
&
sl
->
cabac
,
&
(
sl
->
cabac_state
+
70
)[
ctx
]
);
return
get_cabac_noinline
(
&
sl
->
cabac
,
&
(
sl
->
cabac_state
+
70
)[
ctx
]
);
}
}
static
int
decode_cabac_intra_mb_type
(
const
H264Context
*
h
,
H264SliceContext
*
sl
,
static
int
decode_cabac_intra_mb_type
(
H264SliceContext
*
sl
,
int
ctx_base
,
int
intra_slice
)
int
ctx_base
,
int
intra_slice
)
{
{
uint8_t
*
state
=
&
sl
->
cabac_state
[
ctx_base
];
uint8_t
*
state
=
&
sl
->
cabac_state
[
ctx_base
];
...
@@ -1363,7 +1363,7 @@ static int decode_cabac_mb_skip(const H264Context *h, H264SliceContext *sl,
...
@@ -1363,7 +1363,7 @@ static int decode_cabac_mb_skip(const H264Context *h, H264SliceContext *sl,
return
get_cabac_noinline
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
11
+
ctx
]
);
return
get_cabac_noinline
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
11
+
ctx
]
);
}
}
static
int
decode_cabac_mb_intra4x4_pred_mode
(
const
H264Context
*
h
,
H264SliceContext
*
sl
,
int
pred_mode
)
static
int
decode_cabac_mb_intra4x4_pred_mode
(
H264SliceContext
*
sl
,
int
pred_mode
)
{
{
int
mode
=
0
;
int
mode
=
0
;
...
@@ -1402,7 +1402,7 @@ static int decode_cabac_mb_chroma_pre_mode(const H264Context *h, H264SliceContex
...
@@ -1402,7 +1402,7 @@ static int decode_cabac_mb_chroma_pre_mode(const H264Context *h, H264SliceContex
return
3
;
return
3
;
}
}
static
int
decode_cabac_mb_cbp_luma
(
const
H264Context
*
h
,
H264SliceContext
*
sl
)
static
int
decode_cabac_mb_cbp_luma
(
H264SliceContext
*
sl
)
{
{
int
cbp_b
,
cbp_a
,
ctx
,
cbp
=
0
;
int
cbp_b
,
cbp_a
,
ctx
,
cbp
=
0
;
...
@@ -1419,7 +1419,7 @@ static int decode_cabac_mb_cbp_luma(const H264Context *h, H264SliceContext *sl)
...
@@ -1419,7 +1419,7 @@ static int decode_cabac_mb_cbp_luma(const H264Context *h, H264SliceContext *sl)
cbp
+=
get_cabac_noinline
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
73
+
ctx
])
<<
3
;
cbp
+=
get_cabac_noinline
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
73
+
ctx
])
<<
3
;
return
cbp
;
return
cbp
;
}
}
static
int
decode_cabac_mb_cbp_chroma
(
const
H264Context
*
h
,
H264SliceContext
*
sl
)
static
int
decode_cabac_mb_cbp_chroma
(
H264SliceContext
*
sl
)
{
{
int
ctx
;
int
ctx
;
int
cbp_a
,
cbp_b
;
int
cbp_a
,
cbp_b
;
...
@@ -1439,7 +1439,7 @@ static int decode_cabac_mb_cbp_chroma(const H264Context *h, H264SliceContext *sl
...
@@ -1439,7 +1439,7 @@ static int decode_cabac_mb_cbp_chroma(const H264Context *h, H264SliceContext *sl
return
1
+
get_cabac_noinline
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
77
+
ctx
]
);
return
1
+
get_cabac_noinline
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
77
+
ctx
]
);
}
}
static
int
decode_cabac_p_mb_sub_type
(
const
H264Context
*
h
,
H264SliceContext
*
sl
)
static
int
decode_cabac_p_mb_sub_type
(
H264SliceContext
*
sl
)
{
{
if
(
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
21
]
)
)
if
(
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
21
]
)
)
return
0
;
/* 8x8 */
return
0
;
/* 8x8 */
...
@@ -1449,7 +1449,7 @@ static int decode_cabac_p_mb_sub_type(const H264Context *h, H264SliceContext *sl
...
@@ -1449,7 +1449,7 @@ static int decode_cabac_p_mb_sub_type(const H264Context *h, H264SliceContext *sl
return
2
;
/* 4x8 */
return
2
;
/* 4x8 */
return
3
;
/* 4x4 */
return
3
;
/* 4x4 */
}
}
static
int
decode_cabac_b_mb_sub_type
(
const
H264Context
*
h
,
H264SliceContext
*
sl
)
static
int
decode_cabac_b_mb_sub_type
(
H264SliceContext
*
sl
)
{
{
int
type
;
int
type
;
if
(
!
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
36
]
)
)
if
(
!
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
36
]
)
)
...
@@ -1467,7 +1467,7 @@ static int decode_cabac_b_mb_sub_type(const H264Context *h, H264SliceContext *sl
...
@@ -1467,7 +1467,7 @@ static int decode_cabac_b_mb_sub_type(const H264Context *h, H264SliceContext *sl
return
type
;
return
type
;
}
}
static
int
decode_cabac_mb_ref
(
const
H264Context
*
h
,
H264SliceContext
*
sl
,
int
list
,
int
n
)
static
int
decode_cabac_mb_ref
(
H264SliceContext
*
sl
,
int
list
,
int
n
)
{
{
int
refa
=
sl
->
ref_cache
[
list
][
scan8
[
n
]
-
1
];
int
refa
=
sl
->
ref_cache
[
list
][
scan8
[
n
]
-
1
];
int
refb
=
sl
->
ref_cache
[
list
][
scan8
[
n
]
-
8
];
int
refb
=
sl
->
ref_cache
[
list
][
scan8
[
n
]
-
8
];
...
@@ -1496,7 +1496,7 @@ static int decode_cabac_mb_ref(const H264Context *h, H264SliceContext *sl, int l
...
@@ -1496,7 +1496,7 @@ static int decode_cabac_mb_ref(const H264Context *h, H264SliceContext *sl, int l
return
ref
;
return
ref
;
}
}
static
int
decode_cabac_mb_mvd
(
const
H264Context
*
h
,
H264SliceContext
*
sl
,
int
ctxbase
,
int
amvd
,
int
*
mvda
)
static
int
decode_cabac_mb_mvd
(
H264SliceContext
*
sl
,
int
ctxbase
,
int
amvd
,
int
*
mvda
)
{
{
int
mvd
;
int
mvd
;
...
@@ -1520,7 +1520,7 @@ static int decode_cabac_mb_mvd(const H264Context *h, H264SliceContext *sl, int c
...
@@ -1520,7 +1520,7 @@ static int decode_cabac_mb_mvd(const H264Context *h, H264SliceContext *sl, int c
mvd
+=
1
<<
k
;
mvd
+=
1
<<
k
;
k
++
;
k
++
;
if
(
k
>
24
){
if
(
k
>
24
){
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"overflow in decode_cabac_mb_mvd
\n
"
);
av_log
(
sl
->
h264
->
avctx
,
AV_LOG_ERROR
,
"overflow in decode_cabac_mb_mvd
\n
"
);
return
INT_MIN
;
return
INT_MIN
;
}
}
}
}
...
@@ -1533,18 +1533,18 @@ static int decode_cabac_mb_mvd(const H264Context *h, H264SliceContext *sl, int c
...
@@ -1533,18 +1533,18 @@ static int decode_cabac_mb_mvd(const H264Context *h, H264SliceContext *sl, int c
return
get_cabac_bypass_sign
(
&
sl
->
cabac
,
-
mvd
);
return
get_cabac_bypass_sign
(
&
sl
->
cabac
,
-
mvd
);
}
}
#define DECODE_CABAC_MB_MVD(
h,
list, n )\
#define DECODE_CABAC_MB_MVD(
sl,
list, n )\
{\
{\
int amvd0 = sl->mvd_cache[list][scan8[n] - 1][0] +\
int amvd0 = sl->mvd_cache[list][scan8[n] - 1][0] +\
sl->mvd_cache[list][scan8[n] - 8][0];\
sl->mvd_cache[list][scan8[n] - 8][0];\
int amvd1 = sl->mvd_cache[list][scan8[n] - 1][1] +\
int amvd1 = sl->mvd_cache[list][scan8[n] - 1][1] +\
sl->mvd_cache[list][scan8[n] - 8][1];\
sl->mvd_cache[list][scan8[n] - 8][1];\
\
\
mx += decode_cabac_mb_mvd(
h,
sl, 40, amvd0, &mpx);\
mx += decode_cabac_mb_mvd(sl, 40, amvd0, &mpx);\
my += decode_cabac_mb_mvd(
h,
sl, 47, amvd1, &mpy);\
my += decode_cabac_mb_mvd(sl, 47, amvd1, &mpy);\
}
}
static
av_always_inline
int
get_cabac_cbf_ctx
(
const
H264Context
*
h
,
H264SliceContext
*
sl
,
static
av_always_inline
int
get_cabac_cbf_ctx
(
H264SliceContext
*
sl
,
int
cat
,
int
idx
,
int
max_coeff
,
int
cat
,
int
idx
,
int
max_coeff
,
int
is_dc
)
int
is_dc
)
{
{
...
@@ -1813,7 +1813,7 @@ static av_always_inline void decode_cabac_residual_dc(const H264Context *h,
...
@@ -1813,7 +1813,7 @@ static av_always_inline void decode_cabac_residual_dc(const H264Context *h,
int
max_coeff
)
int
max_coeff
)
{
{
/* read coded block flag */
/* read coded block flag */
if
(
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
get_cabac_cbf_ctx
(
h
,
sl
,
cat
,
n
,
max_coeff
,
1
)])
==
0
)
{
if
(
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
get_cabac_cbf_ctx
(
sl
,
cat
,
n
,
max_coeff
,
1
)])
==
0
)
{
sl
->
non_zero_count_cache
[
scan8
[
n
]]
=
0
;
sl
->
non_zero_count_cache
[
scan8
[
n
]]
=
0
;
return
;
return
;
}
}
...
@@ -1827,7 +1827,7 @@ decode_cabac_residual_dc_422(const H264Context *h, H264SliceContext *sl,
...
@@ -1827,7 +1827,7 @@ decode_cabac_residual_dc_422(const H264Context *h, H264SliceContext *sl,
int
max_coeff
)
int
max_coeff
)
{
{
/* read coded block flag */
/* read coded block flag */
if
(
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
get_cabac_cbf_ctx
(
h
,
sl
,
cat
,
n
,
max_coeff
,
1
)])
==
0
)
{
if
(
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
get_cabac_cbf_ctx
(
sl
,
cat
,
n
,
max_coeff
,
1
)])
==
0
)
{
sl
->
non_zero_count_cache
[
scan8
[
n
]]
=
0
;
sl
->
non_zero_count_cache
[
scan8
[
n
]]
=
0
;
return
;
return
;
}
}
...
@@ -1843,7 +1843,7 @@ static av_always_inline void decode_cabac_residual_nondc(const H264Context *h,
...
@@ -1843,7 +1843,7 @@ static av_always_inline void decode_cabac_residual_nondc(const H264Context *h,
int
max_coeff
)
int
max_coeff
)
{
{
/* read coded block flag */
/* read coded block flag */
if
(
(
cat
!=
5
||
CHROMA444
(
h
))
&&
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
get_cabac_cbf_ctx
(
h
,
sl
,
cat
,
n
,
max_coeff
,
0
)])
==
0
)
{
if
(
(
cat
!=
5
||
CHROMA444
(
h
))
&&
get_cabac
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
get_cabac_cbf_ctx
(
sl
,
cat
,
n
,
max_coeff
,
0
)])
==
0
)
{
if
(
max_coeff
==
64
)
{
if
(
max_coeff
==
64
)
{
fill_rectangle
(
&
sl
->
non_zero_count_cache
[
scan8
[
n
]],
2
,
2
,
8
,
0
,
1
);
fill_rectangle
(
&
sl
->
non_zero_count_cache
[
scan8
[
n
]],
2
,
2
,
8
,
0
,
1
);
}
else
{
}
else
{
...
@@ -1975,7 +1975,7 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
...
@@ -1975,7 +1975,7 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
if
(
bits
<
8
){
if
(
bits
<
8
){
mb_type
=
bits
+
3
;
/* B_Bi_16x16 through B_L1_L0_16x8 */
mb_type
=
bits
+
3
;
/* B_Bi_16x16 through B_L1_L0_16x8 */
}
else
if
(
bits
==
13
){
}
else
if
(
bits
==
13
){
mb_type
=
decode_cabac_intra_mb_type
(
h
,
sl
,
32
,
0
);
mb_type
=
decode_cabac_intra_mb_type
(
sl
,
32
,
0
);
goto
decode_intra_mb
;
goto
decode_intra_mb
;
}
else
if
(
bits
==
14
){
}
else
if
(
bits
==
14
){
mb_type
=
11
;
/* B_L1_L0_8x16 */
mb_type
=
11
;
/* B_L1_L0_8x16 */
...
@@ -2001,11 +2001,11 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
...
@@ -2001,11 +2001,11 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
partition_count
=
p_mb_type_info
[
mb_type
].
partition_count
;
partition_count
=
p_mb_type_info
[
mb_type
].
partition_count
;
mb_type
=
p_mb_type_info
[
mb_type
].
type
;
mb_type
=
p_mb_type_info
[
mb_type
].
type
;
}
else
{
}
else
{
mb_type
=
decode_cabac_intra_mb_type
(
h
,
sl
,
17
,
0
);
mb_type
=
decode_cabac_intra_mb_type
(
sl
,
17
,
0
);
goto
decode_intra_mb
;
goto
decode_intra_mb
;
}
}
}
else
{
}
else
{
mb_type
=
decode_cabac_intra_mb_type
(
h
,
sl
,
3
,
1
);
mb_type
=
decode_cabac_intra_mb_type
(
sl
,
3
,
1
);
if
(
sl
->
slice_type
==
AV_PICTURE_TYPE_SI
&&
mb_type
)
if
(
sl
->
slice_type
==
AV_PICTURE_TYPE_SI
&&
mb_type
)
mb_type
--
;
mb_type
--
;
assert
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_I
);
assert
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_I
);
...
@@ -2063,13 +2063,13 @@ decode_intra_mb:
...
@@ -2063,13 +2063,13 @@ decode_intra_mb:
mb_type
|=
MB_TYPE_8x8DCT
;
mb_type
|=
MB_TYPE_8x8DCT
;
for
(
i
=
0
;
i
<
16
;
i
+=
4
)
{
for
(
i
=
0
;
i
<
16
;
i
+=
4
)
{
int
pred
=
pred_intra_mode
(
h
,
sl
,
i
);
int
pred
=
pred_intra_mode
(
h
,
sl
,
i
);
int
mode
=
decode_cabac_mb_intra4x4_pred_mode
(
h
,
sl
,
pred
);
int
mode
=
decode_cabac_mb_intra4x4_pred_mode
(
sl
,
pred
);
fill_rectangle
(
&
sl
->
intra4x4_pred_mode_cache
[
scan8
[
i
]],
2
,
2
,
8
,
mode
,
1
);
fill_rectangle
(
&
sl
->
intra4x4_pred_mode_cache
[
scan8
[
i
]],
2
,
2
,
8
,
mode
,
1
);
}
}
}
else
{
}
else
{
for
(
i
=
0
;
i
<
16
;
i
++
)
{
for
(
i
=
0
;
i
<
16
;
i
++
)
{
int
pred
=
pred_intra_mode
(
h
,
sl
,
i
);
int
pred
=
pred_intra_mode
(
h
,
sl
,
i
);
sl
->
intra4x4_pred_mode_cache
[
scan8
[
i
]]
=
decode_cabac_mb_intra4x4_pred_mode
(
h
,
sl
,
pred
);
sl
->
intra4x4_pred_mode_cache
[
scan8
[
i
]]
=
decode_cabac_mb_intra4x4_pred_mode
(
sl
,
pred
);
av_dlog
(
h
->
avctx
,
"i4x4 pred=%d mode=%d
\n
"
,
pred
,
av_dlog
(
h
->
avctx
,
"i4x4 pred=%d mode=%d
\n
"
,
pred
,
h
->
intra4x4_pred_mode_cache
[
scan8
[
i
]]);
h
->
intra4x4_pred_mode_cache
[
scan8
[
i
]]);
...
@@ -2096,7 +2096,7 @@ decode_intra_mb:
...
@@ -2096,7 +2096,7 @@ decode_intra_mb:
if
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_B
)
{
if
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_B
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
sl
->
sub_mb_type
[
i
]
=
decode_cabac_b_mb_sub_type
(
h
,
sl
);
sl
->
sub_mb_type
[
i
]
=
decode_cabac_b_mb_sub_type
(
sl
);
sub_partition_count
[
i
]
=
b_sub_mb_type_info
[
sl
->
sub_mb_type
[
i
]].
partition_count
;
sub_partition_count
[
i
]
=
b_sub_mb_type_info
[
sl
->
sub_mb_type
[
i
]].
partition_count
;
sl
->
sub_mb_type
[
i
]
=
b_sub_mb_type_info
[
sl
->
sub_mb_type
[
i
]].
type
;
sl
->
sub_mb_type
[
i
]
=
b_sub_mb_type_info
[
sl
->
sub_mb_type
[
i
]].
type
;
}
}
...
@@ -2112,7 +2112,7 @@ decode_intra_mb:
...
@@ -2112,7 +2112,7 @@ decode_intra_mb:
}
}
}
else
{
}
else
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
sl
->
sub_mb_type
[
i
]
=
decode_cabac_p_mb_sub_type
(
h
,
sl
);
sl
->
sub_mb_type
[
i
]
=
decode_cabac_p_mb_sub_type
(
sl
);
sub_partition_count
[
i
]
=
p_sub_mb_type_info
[
sl
->
sub_mb_type
[
i
]].
partition_count
;
sub_partition_count
[
i
]
=
p_sub_mb_type_info
[
sl
->
sub_mb_type
[
i
]].
partition_count
;
sl
->
sub_mb_type
[
i
]
=
p_sub_mb_type_info
[
sl
->
sub_mb_type
[
i
]].
type
;
sl
->
sub_mb_type
[
i
]
=
p_sub_mb_type_info
[
sl
->
sub_mb_type
[
i
]].
type
;
}
}
...
@@ -2124,7 +2124,7 @@ decode_intra_mb:
...
@@ -2124,7 +2124,7 @@ decode_intra_mb:
if
(
IS_DIR
(
sl
->
sub_mb_type
[
i
],
0
,
list
)){
if
(
IS_DIR
(
sl
->
sub_mb_type
[
i
],
0
,
list
)){
int
rc
=
sl
->
ref_count
[
list
]
<<
MB_MBAFF
(
sl
);
int
rc
=
sl
->
ref_count
[
list
]
<<
MB_MBAFF
(
sl
);
if
(
rc
>
1
)
{
if
(
rc
>
1
)
{
ref
[
list
][
i
]
=
decode_cabac_mb_ref
(
h
,
sl
,
list
,
4
*
i
);
ref
[
list
][
i
]
=
decode_cabac_mb_ref
(
sl
,
list
,
4
*
i
);
if
(
ref
[
list
][
i
]
>=
(
unsigned
)
rc
)
{
if
(
ref
[
list
][
i
]
>=
(
unsigned
)
rc
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Reference %d >= %d
\n
"
,
ref
[
list
][
i
],
rc
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Reference %d >= %d
\n
"
,
ref
[
list
][
i
],
rc
);
return
-
1
;
return
-
1
;
...
@@ -2160,7 +2160,7 @@ decode_intra_mb:
...
@@ -2160,7 +2160,7 @@ decode_intra_mb:
int16_t
(
*
mv_cache
)[
2
]
=
&
sl
->
mv_cache
[
list
][
scan8
[
index
]
];
int16_t
(
*
mv_cache
)[
2
]
=
&
sl
->
mv_cache
[
list
][
scan8
[
index
]
];
uint8_t
(
*
mvd_cache
)[
2
]
=
&
sl
->
mvd_cache
[
list
][
scan8
[
index
]
];
uint8_t
(
*
mvd_cache
)[
2
]
=
&
sl
->
mvd_cache
[
list
][
scan8
[
index
]
];
pred_motion
(
h
,
sl
,
index
,
block_width
,
list
,
sl
->
ref_cache
[
list
][
scan8
[
index
]
],
&
mx
,
&
my
);
pred_motion
(
h
,
sl
,
index
,
block_width
,
list
,
sl
->
ref_cache
[
list
][
scan8
[
index
]
],
&
mx
,
&
my
);
DECODE_CABAC_MB_MVD
(
h
,
list
,
index
)
DECODE_CABAC_MB_MVD
(
sl
,
list
,
index
)
tprintf
(
h
->
avctx
,
"final mv:%d %d
\n
"
,
mx
,
my
);
tprintf
(
h
->
avctx
,
"final mv:%d %d
\n
"
,
mx
,
my
);
if
(
IS_SUB_8X8
(
sub_mb_type
)){
if
(
IS_SUB_8X8
(
sub_mb_type
)){
...
@@ -2210,7 +2210,7 @@ decode_intra_mb:
...
@@ -2210,7 +2210,7 @@ decode_intra_mb:
if
(
IS_DIR
(
mb_type
,
0
,
list
)){
if
(
IS_DIR
(
mb_type
,
0
,
list
)){
int
ref
,
rc
=
sl
->
ref_count
[
list
]
<<
MB_MBAFF
(
sl
);
int
ref
,
rc
=
sl
->
ref_count
[
list
]
<<
MB_MBAFF
(
sl
);
if
(
rc
>
1
)
{
if
(
rc
>
1
)
{
ref
=
decode_cabac_mb_ref
(
h
,
sl
,
list
,
0
);
ref
=
decode_cabac_mb_ref
(
sl
,
list
,
0
);
if
(
ref
>=
(
unsigned
)
rc
)
{
if
(
ref
>=
(
unsigned
)
rc
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Reference %d >= %d
\n
"
,
ref
,
rc
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Reference %d >= %d
\n
"
,
ref
,
rc
);
return
-
1
;
return
-
1
;
...
@@ -2224,7 +2224,7 @@ decode_intra_mb:
...
@@ -2224,7 +2224,7 @@ decode_intra_mb:
if
(
IS_DIR
(
mb_type
,
0
,
list
)){
if
(
IS_DIR
(
mb_type
,
0
,
list
)){
int
mx
,
my
,
mpx
,
mpy
;
int
mx
,
my
,
mpx
,
mpy
;
pred_motion
(
h
,
sl
,
0
,
4
,
list
,
sl
->
ref_cache
[
list
][
scan8
[
0
]
],
&
mx
,
&
my
);
pred_motion
(
h
,
sl
,
0
,
4
,
list
,
sl
->
ref_cache
[
list
][
scan8
[
0
]
],
&
mx
,
&
my
);
DECODE_CABAC_MB_MVD
(
h
,
list
,
0
)
DECODE_CABAC_MB_MVD
(
sl
,
list
,
0
)
tprintf
(
h
->
avctx
,
"final mv:%d %d
\n
"
,
mx
,
my
);
tprintf
(
h
->
avctx
,
"final mv:%d %d
\n
"
,
mx
,
my
);
fill_rectangle
(
sl
->
mvd_cache
[
list
][
scan8
[
0
]
],
4
,
4
,
8
,
pack8to16
(
mpx
,
mpy
),
2
);
fill_rectangle
(
sl
->
mvd_cache
[
list
][
scan8
[
0
]
],
4
,
4
,
8
,
pack8to16
(
mpx
,
mpy
),
2
);
...
@@ -2238,7 +2238,7 @@ decode_intra_mb:
...
@@ -2238,7 +2238,7 @@ decode_intra_mb:
if
(
IS_DIR
(
mb_type
,
i
,
list
)){
if
(
IS_DIR
(
mb_type
,
i
,
list
)){
int
ref
,
rc
=
sl
->
ref_count
[
list
]
<<
MB_MBAFF
(
sl
);
int
ref
,
rc
=
sl
->
ref_count
[
list
]
<<
MB_MBAFF
(
sl
);
if
(
rc
>
1
)
{
if
(
rc
>
1
)
{
ref
=
decode_cabac_mb_ref
(
h
,
sl
,
list
,
8
*
i
);
ref
=
decode_cabac_mb_ref
(
sl
,
list
,
8
*
i
);
if
(
ref
>=
(
unsigned
)
rc
)
{
if
(
ref
>=
(
unsigned
)
rc
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Reference %d >= %d
\n
"
,
ref
,
rc
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Reference %d >= %d
\n
"
,
ref
,
rc
);
return
-
1
;
return
-
1
;
...
@@ -2255,7 +2255,7 @@ decode_intra_mb:
...
@@ -2255,7 +2255,7 @@ decode_intra_mb:
if
(
IS_DIR
(
mb_type
,
i
,
list
)){
if
(
IS_DIR
(
mb_type
,
i
,
list
)){
int
mx
,
my
,
mpx
,
mpy
;
int
mx
,
my
,
mpx
,
mpy
;
pred_16x8_motion
(
h
,
sl
,
8
*
i
,
list
,
sl
->
ref_cache
[
list
][
scan8
[
0
]
+
16
*
i
],
&
mx
,
&
my
);
pred_16x8_motion
(
h
,
sl
,
8
*
i
,
list
,
sl
->
ref_cache
[
list
][
scan8
[
0
]
+
16
*
i
],
&
mx
,
&
my
);
DECODE_CABAC_MB_MVD
(
h
,
list
,
8
*
i
)
DECODE_CABAC_MB_MVD
(
sl
,
list
,
8
*
i
)
tprintf
(
h
->
avctx
,
"final mv:%d %d
\n
"
,
mx
,
my
);
tprintf
(
h
->
avctx
,
"final mv:%d %d
\n
"
,
mx
,
my
);
fill_rectangle
(
sl
->
mvd_cache
[
list
][
scan8
[
0
]
+
16
*
i
],
4
,
2
,
8
,
pack8to16
(
mpx
,
mpy
),
2
);
fill_rectangle
(
sl
->
mvd_cache
[
list
][
scan8
[
0
]
+
16
*
i
],
4
,
2
,
8
,
pack8to16
(
mpx
,
mpy
),
2
);
...
@@ -2273,7 +2273,7 @@ decode_intra_mb:
...
@@ -2273,7 +2273,7 @@ decode_intra_mb:
if
(
IS_DIR
(
mb_type
,
i
,
list
)){
//FIXME optimize
if
(
IS_DIR
(
mb_type
,
i
,
list
)){
//FIXME optimize
int
ref
,
rc
=
sl
->
ref_count
[
list
]
<<
MB_MBAFF
(
sl
);
int
ref
,
rc
=
sl
->
ref_count
[
list
]
<<
MB_MBAFF
(
sl
);
if
(
rc
>
1
)
{
if
(
rc
>
1
)
{
ref
=
decode_cabac_mb_ref
(
h
,
sl
,
list
,
4
*
i
);
ref
=
decode_cabac_mb_ref
(
sl
,
list
,
4
*
i
);
if
(
ref
>=
(
unsigned
)
rc
)
{
if
(
ref
>=
(
unsigned
)
rc
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Reference %d >= %d
\n
"
,
ref
,
rc
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Reference %d >= %d
\n
"
,
ref
,
rc
);
return
-
1
;
return
-
1
;
...
@@ -2290,7 +2290,7 @@ decode_intra_mb:
...
@@ -2290,7 +2290,7 @@ decode_intra_mb:
if
(
IS_DIR
(
mb_type
,
i
,
list
)){
if
(
IS_DIR
(
mb_type
,
i
,
list
)){
int
mx
,
my
,
mpx
,
mpy
;
int
mx
,
my
,
mpx
,
mpy
;
pred_8x16_motion
(
h
,
sl
,
i
*
4
,
list
,
sl
->
ref_cache
[
list
][
scan8
[
0
]
+
2
*
i
],
&
mx
,
&
my
);
pred_8x16_motion
(
h
,
sl
,
i
*
4
,
list
,
sl
->
ref_cache
[
list
][
scan8
[
0
]
+
2
*
i
],
&
mx
,
&
my
);
DECODE_CABAC_MB_MVD
(
h
,
list
,
4
*
i
)
DECODE_CABAC_MB_MVD
(
sl
,
list
,
4
*
i
)
tprintf
(
h
->
avctx
,
"final mv:%d %d
\n
"
,
mx
,
my
);
tprintf
(
h
->
avctx
,
"final mv:%d %d
\n
"
,
mx
,
my
);
fill_rectangle
(
sl
->
mvd_cache
[
list
][
scan8
[
0
]
+
2
*
i
],
2
,
4
,
8
,
pack8to16
(
mpx
,
mpy
),
2
);
fill_rectangle
(
sl
->
mvd_cache
[
list
][
scan8
[
0
]
+
2
*
i
],
2
,
4
,
8
,
pack8to16
(
mpx
,
mpy
),
2
);
...
@@ -2310,9 +2310,9 @@ decode_intra_mb:
...
@@ -2310,9 +2310,9 @@ decode_intra_mb:
}
}
if
(
!
IS_INTRA16x16
(
mb_type
)
)
{
if
(
!
IS_INTRA16x16
(
mb_type
)
)
{
cbp
=
decode_cabac_mb_cbp_luma
(
h
,
sl
);
cbp
=
decode_cabac_mb_cbp_luma
(
sl
);
if
(
decode_chroma
)
if
(
decode_chroma
)
cbp
|=
decode_cabac_mb_cbp_chroma
(
h
,
sl
)
<<
4
;
cbp
|=
decode_cabac_mb_cbp_chroma
(
sl
)
<<
4
;
}
}
h
->
cbp_table
[
mb_xy
]
=
sl
->
cbp
=
cbp
;
h
->
cbp_table
[
mb_xy
]
=
sl
->
cbp
=
cbp
;
...
...
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