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
4bd5ac20
Commit
4bd5ac20
authored
Jan 17, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: move {chroma,intra16x16}_pred_mode into the per-slice context
parent
5355ed6b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
26 deletions
+26
-26
h264.h
libavcodec/h264.h
+3
-3
h264_cabac.c
libavcodec/h264_cabac.c
+5
-5
h264_cavlc.c
libavcodec/h264_cavlc.c
+5
-5
h264_mb.c
libavcodec/h264_mb.c
+4
-4
h264_mb_template.c
libavcodec/h264_mb_template.c
+6
-6
svq3.c
libavcodec/svq3.c
+3
-3
No files found.
libavcodec/h264.h
View file @
4bd5ac20
...
...
@@ -317,6 +317,9 @@ typedef struct H264SliceContext {
int
prev_mb_skipped
;
int
next_mb_skipped
;
int
chroma_pred_mode
;
int
intra16x16_pred_mode
;
}
H264SliceContext
;
/**
...
...
@@ -354,9 +357,6 @@ typedef struct H264Context {
int
workaround_bugs
;
// prediction stuff
int
chroma_pred_mode
;
int
intra16x16_pred_mode
;
int
topleft_mb_xy
;
int
top_mb_xy
;
int
topright_mb_xy
;
...
...
libavcodec/h264_cabac.c
View file @
4bd5ac20
...
...
@@ -1989,7 +1989,7 @@ int ff_h264_decode_mb_cabac(H264Context *h, H264SliceContext *sl)
decode_intra_mb:
partition_count
=
0
;
cbp
=
i_mb_type_info
[
mb_type
].
cbp
;
h
->
intra16x16_pred_mode
=
i_mb_type_info
[
mb_type
].
pred_mode
;
sl
->
intra16x16_pred_mode
=
i_mb_type_info
[
mb_type
].
pred_mode
;
mb_type
=
i_mb_type_info
[
mb_type
].
type
;
}
if
(
MB_FIELD
(
h
))
...
...
@@ -2055,8 +2055,8 @@ decode_intra_mb:
write_back_intra_pred_mode
(
h
);
if
(
ff_h264_check_intra4x4_pred_mode
(
h
)
<
0
)
return
-
1
;
}
else
{
h
->
intra16x16_pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
h
->
intra16x16_pred_mode
,
0
);
if
(
h
->
intra16x16_pred_mode
<
0
)
return
-
1
;
sl
->
intra16x16_pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
sl
->
intra16x16_pred_mode
,
0
);
if
(
sl
->
intra16x16_pred_mode
<
0
)
return
-
1
;
}
if
(
decode_chroma
){
h
->
chroma_pred_mode_table
[
mb_xy
]
=
...
...
@@ -2064,9 +2064,9 @@ decode_intra_mb:
pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
pred_mode
,
1
);
if
(
pred_mode
<
0
)
return
-
1
;
h
->
chroma_pred_mode
=
pred_mode
;
sl
->
chroma_pred_mode
=
pred_mode
;
}
else
{
h
->
chroma_pred_mode
=
DC_128_PRED8x8
;
sl
->
chroma_pred_mode
=
DC_128_PRED8x8
;
}
}
else
if
(
partition_count
==
4
)
{
int
i
,
j
,
sub_partition_count
[
4
],
list
,
ref
[
2
][
4
];
...
...
libavcodec/h264_cavlc.c
View file @
4bd5ac20
...
...
@@ -751,7 +751,7 @@ decode_intra_mb:
}
partition_count
=
0
;
cbp
=
i_mb_type_info
[
mb_type
].
cbp
;
h
->
intra16x16_pred_mode
=
i_mb_type_info
[
mb_type
].
pred_mode
;
sl
->
intra16x16_pred_mode
=
i_mb_type_info
[
mb_type
].
pred_mode
;
mb_type
=
i_mb_type_info
[
mb_type
].
type
;
}
...
...
@@ -814,17 +814,17 @@ decode_intra_mb:
if
(
ff_h264_check_intra4x4_pred_mode
(
h
)
<
0
)
return
-
1
;
}
else
{
h
->
intra16x16_pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
h
->
intra16x16_pred_mode
,
0
);
if
(
h
->
intra16x16_pred_mode
<
0
)
sl
->
intra16x16_pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
sl
->
intra16x16_pred_mode
,
0
);
if
(
sl
->
intra16x16_pred_mode
<
0
)
return
-
1
;
}
if
(
decode_chroma
){
pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
get_ue_golomb_31
(
&
h
->
gb
),
1
);
if
(
pred_mode
<
0
)
return
-
1
;
h
->
chroma_pred_mode
=
pred_mode
;
sl
->
chroma_pred_mode
=
pred_mode
;
}
else
{
h
->
chroma_pred_mode
=
DC_128_PRED8x8
;
sl
->
chroma_pred_mode
=
DC_128_PRED8x8
;
}
}
else
if
(
partition_count
==
4
){
int
i
,
j
,
sub_partition_count
[
4
],
list
,
ref
[
2
][
4
];
...
...
libavcodec/h264_mb.c
View file @
4bd5ac20
...
...
@@ -694,7 +694,7 @@ static av_always_inline void hl_decode_mb_predict_luma(H264Context *h,
}
}
}
else
{
h
->
hpc
.
pred16x16
[
h
->
intra16x16_pred_mode
](
dest_y
,
linesize
);
h
->
hpc
.
pred16x16
[
sl
->
intra16x16_pred_mode
](
dest_y
,
linesize
);
if
(
is_h264
)
{
if
(
h
->
non_zero_count_cache
[
scan8
[
LUMA_DC_BLOCK_INDEX
+
p
]])
{
if
(
!
transform_bypass
)
...
...
@@ -738,9 +738,9 @@ static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, H264SliceCon
if
(
IS_INTRA16x16
(
mb_type
))
{
if
(
transform_bypass
)
{
if
(
h
->
sps
.
profile_idc
==
244
&&
(
h
->
intra16x16_pred_mode
==
VERT_PRED8x8
||
h
->
intra16x16_pred_mode
==
HOR_PRED8x8
))
{
h
->
hpc
.
pred16x16_add
[
h
->
intra16x16_pred_mode
](
dest_y
,
block_offset
,
(
sl
->
intra16x16_pred_mode
==
VERT_PRED8x8
||
sl
->
intra16x16_pred_mode
==
HOR_PRED8x8
))
{
h
->
hpc
.
pred16x16_add
[
sl
->
intra16x16_pred_mode
](
dest_y
,
block_offset
,
h
->
mb
+
(
p
*
256
<<
pixel_shift
),
linesize
);
}
else
{
...
...
libavcodec/h264_mb_template.c
View file @
4bd5ac20
...
...
@@ -163,8 +163,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
uvlinesize
,
1
,
0
,
SIMPLE
,
PIXEL_SHIFT
);
if
(
SIMPLE
||
!
CONFIG_GRAY
||
!
(
h
->
flags
&
CODEC_FLAG_GRAY
))
{
h
->
hpc
.
pred8x8
[
h
->
chroma_pred_mode
](
dest_cb
,
uvlinesize
);
h
->
hpc
.
pred8x8
[
h
->
chroma_pred_mode
](
dest_cr
,
uvlinesize
);
h
->
hpc
.
pred8x8
[
sl
->
chroma_pred_mode
](
dest_cb
,
uvlinesize
);
h
->
hpc
.
pred8x8
[
sl
->
chroma_pred_mode
](
dest_cr
,
uvlinesize
);
}
hl_decode_mb_predict_luma
(
h
,
sl
,
mb_type
,
is_h264
,
SIMPLE
,
...
...
@@ -198,13 +198,13 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
uint8_t
*
dest
[
2
]
=
{
dest_cb
,
dest_cr
};
if
(
transform_bypass
)
{
if
(
IS_INTRA
(
mb_type
)
&&
h
->
sps
.
profile_idc
==
244
&&
(
h
->
chroma_pred_mode
==
VERT_PRED8x8
||
h
->
chroma_pred_mode
==
HOR_PRED8x8
))
{
h
->
hpc
.
pred8x8_add
[
h
->
chroma_pred_mode
](
dest
[
0
],
(
sl
->
chroma_pred_mode
==
VERT_PRED8x8
||
sl
->
chroma_pred_mode
==
HOR_PRED8x8
))
{
h
->
hpc
.
pred8x8_add
[
sl
->
chroma_pred_mode
](
dest
[
0
],
block_offset
+
16
,
h
->
mb
+
(
16
*
16
*
1
<<
PIXEL_SHIFT
),
uvlinesize
);
h
->
hpc
.
pred8x8_add
[
h
->
chroma_pred_mode
](
dest
[
1
],
h
->
hpc
.
pred8x8_add
[
sl
->
chroma_pred_mode
](
dest
[
1
],
block_offset
+
32
,
h
->
mb
+
(
16
*
16
*
2
<<
PIXEL_SHIFT
),
uvlinesize
);
...
...
libavcodec/svq3.c
View file @
4bd5ac20
...
...
@@ -660,9 +660,9 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
dir
=
i_mb_type_info
[
mb_type
-
8
].
pred_mode
;
dir
=
(
dir
>>
1
)
^
3
*
(
dir
&
1
)
^
1
;
if
((
h
->
intra16x16_pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
dir
,
0
))
<
0
)
{
if
((
sl
->
intra16x16_pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
dir
,
0
))
<
0
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"ff_h264_check_intra_pred_mode < 0
\n
"
);
return
h
->
intra16x16_pred_mode
;
return
sl
->
intra16x16_pred_mode
;
}
cbp
=
i_mb_type_info
[
mb_type
-
8
].
cbp
;
...
...
@@ -764,7 +764,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
h
->
cur_pic
.
mb_type
[
mb_xy
]
=
mb_type
;
if
(
IS_INTRA
(
mb_type
))
h
->
chroma_pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
DC_PRED8x8
,
1
);
sl
->
chroma_pred_mode
=
ff_h264_check_intra_pred_mode
(
h
,
DC_PRED8x8
,
1
);
return
0
;
}
...
...
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