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
066aafce
Commit
066aafce
authored
Jan 17, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: move direct_spatial_mv_pred into the per-slice context
parent
ed451a08
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
11 deletions
+12
-11
dxva2_h264.c
libavcodec/dxva2_h264.c
+1
-1
h264.c
libavcodec/h264.c
+1
-1
h264.h
libavcodec/h264.h
+2
-1
h264_direct.c
libavcodec/h264_direct.c
+2
-2
h264_mvpred.h
libavcodec/h264_mvpred.h
+3
-3
h264_slice.c
libavcodec/h264_slice.c
+2
-2
vaapi_h264.c
libavcodec/vaapi_h264.c
+1
-1
No files found.
libavcodec/dxva2_h264.c
View file @
066aafce
...
@@ -279,7 +279,7 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
...
@@ -279,7 +279,7 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
slice
->
slice_qp_delta
=
sl
->
qscale
-
h
->
pps
.
init_qp
;
slice
->
slice_qp_delta
=
sl
->
qscale
-
h
->
pps
.
init_qp
;
slice
->
redundant_pic_cnt
=
h
->
redundant_pic_count
;
slice
->
redundant_pic_cnt
=
h
->
redundant_pic_count
;
if
(
sl
->
slice_type
==
AV_PICTURE_TYPE_B
)
if
(
sl
->
slice_type
==
AV_PICTURE_TYPE_B
)
slice
->
direct_spatial_mv_pred_flag
=
h
->
direct_spatial_mv_pred
;
slice
->
direct_spatial_mv_pred_flag
=
sl
->
direct_spatial_mv_pred
;
slice
->
cabac_init_idc
=
h
->
pps
.
cabac
?
h
->
cabac_init_idc
:
0
;
slice
->
cabac_init_idc
=
h
->
pps
.
cabac
?
h
->
cabac_init_idc
:
0
;
if
(
h
->
deblocking_filter
<
2
)
if
(
h
->
deblocking_filter
<
2
)
slice
->
disable_deblocking_filter_idc
=
1
-
h
->
deblocking_filter
;
slice
->
disable_deblocking_filter_idc
=
1
-
h
->
deblocking_filter
;
...
...
libavcodec/h264.c
View file @
066aafce
...
@@ -1270,7 +1270,7 @@ int ff_set_ref_count(H264Context *h, H264SliceContext *sl)
...
@@ -1270,7 +1270,7 @@ int ff_set_ref_count(H264Context *h, H264SliceContext *sl)
if
(
sl
->
slice_type_nos
!=
AV_PICTURE_TYPE_I
)
{
if
(
sl
->
slice_type_nos
!=
AV_PICTURE_TYPE_I
)
{
if
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_B
)
if
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_B
)
h
->
direct_spatial_mv_pred
=
get_bits1
(
&
h
->
gb
);
sl
->
direct_spatial_mv_pred
=
get_bits1
(
&
h
->
gb
);
num_ref_idx_active_override_flag
=
get_bits1
(
&
h
->
gb
);
num_ref_idx_active_override_flag
=
get_bits1
(
&
h
->
gb
);
if
(
num_ref_idx_active_override_flag
)
{
if
(
num_ref_idx_active_override_flag
)
{
...
...
libavcodec/h264.h
View file @
066aafce
...
@@ -355,6 +355,8 @@ typedef struct H264SliceContext {
...
@@ -355,6 +355,8 @@ typedef struct H264SliceContext {
*/
*/
int
neighbor_transform_size
;
int
neighbor_transform_size
;
int
direct_spatial_mv_pred
;
/**
/**
* non zero coeff count cache.
* non zero coeff count cache.
* is 64 if not available.
* is 64 if not available.
...
@@ -440,7 +442,6 @@ typedef struct H264Context {
...
@@ -440,7 +442,6 @@ typedef struct H264Context {
int
picture_structure
;
int
picture_structure
;
int
first_field
;
int
first_field
;
int
direct_spatial_mv_pred
;
int
col_parity
;
int
col_parity
;
int
col_fieldoff
;
int
col_fieldoff
;
int
dist_scale_factor
[
32
];
int
dist_scale_factor
[
32
];
...
...
libavcodec/h264_direct.c
View file @
066aafce
...
@@ -140,7 +140,7 @@ void ff_h264_direct_ref_list_init(H264Context *const h, H264SliceContext *sl)
...
@@ -140,7 +140,7 @@ void ff_h264_direct_ref_list_init(H264Context *const h, H264SliceContext *sl)
h
->
col_fieldoff
=
2
*
h
->
ref_list
[
1
][
0
].
reference
-
3
;
h
->
col_fieldoff
=
2
*
h
->
ref_list
[
1
][
0
].
reference
-
3
;
}
}
if
(
sl
->
slice_type_nos
!=
AV_PICTURE_TYPE_B
||
h
->
direct_spatial_mv_pred
)
if
(
sl
->
slice_type_nos
!=
AV_PICTURE_TYPE_B
||
sl
->
direct_spatial_mv_pred
)
return
;
return
;
for
(
list
=
0
;
list
<
2
;
list
++
)
{
for
(
list
=
0
;
list
<
2
;
list
++
)
{
...
@@ -694,7 +694,7 @@ single_col:
...
@@ -694,7 +694,7 @@ single_col:
void
ff_h264_pred_direct_motion
(
H264Context
*
const
h
,
H264SliceContext
*
sl
,
void
ff_h264_pred_direct_motion
(
H264Context
*
const
h
,
H264SliceContext
*
sl
,
int
*
mb_type
)
int
*
mb_type
)
{
{
if
(
h
->
direct_spatial_mv_pred
)
if
(
sl
->
direct_spatial_mv_pred
)
pred_spatial_direct_motion
(
h
,
sl
,
mb_type
);
pred_spatial_direct_motion
(
h
,
sl
,
mb_type
);
else
else
pred_temp_direct_motion
(
h
,
sl
,
mb_type
);
pred_temp_direct_motion
(
h
,
sl
,
mb_type
);
...
...
libavcodec/h264_mvpred.h
View file @
066aafce
...
@@ -603,7 +603,7 @@ static void fill_decode_caches(H264Context *h, H264SliceContext *sl, int mb_type
...
@@ -603,7 +603,7 @@ static void fill_decode_caches(H264Context *h, H264SliceContext *sl, int mb_type
}
}
}
}
if
(
IS_INTER
(
mb_type
)
||
(
IS_DIRECT
(
mb_type
)
&&
h
->
direct_spatial_mv_pred
))
{
if
(
IS_INTER
(
mb_type
)
||
(
IS_DIRECT
(
mb_type
)
&&
sl
->
direct_spatial_mv_pred
))
{
int
list
;
int
list
;
int
b_stride
=
h
->
b_stride
;
int
b_stride
=
h
->
b_stride
;
for
(
list
=
0
;
list
<
h
->
list_count
;
list
++
)
{
for
(
list
=
0
;
list
<
h
->
list_count
;
list
++
)
{
...
@@ -613,7 +613,7 @@ static void fill_decode_caches(H264Context *h, H264SliceContext *sl, int mb_type
...
@@ -613,7 +613,7 @@ static void fill_decode_caches(H264Context *h, H264SliceContext *sl, int mb_type
int16_t
(
*
mv
)[
2
]
=
h
->
cur_pic
.
motion_val
[
list
];
int16_t
(
*
mv
)[
2
]
=
h
->
cur_pic
.
motion_val
[
list
];
if
(
!
USES_LIST
(
mb_type
,
list
))
if
(
!
USES_LIST
(
mb_type
,
list
))
continue
;
continue
;
assert
(
!
(
IS_DIRECT
(
mb_type
)
&&
!
h
->
direct_spatial_mv_pred
));
assert
(
!
(
IS_DIRECT
(
mb_type
)
&&
!
sl
->
direct_spatial_mv_pred
));
if
(
USES_LIST
(
top_type
,
list
))
{
if
(
USES_LIST
(
top_type
,
list
))
{
const
int
b_xy
=
h
->
mb2b_xy
[
top_xy
]
+
3
*
b_stride
;
const
int
b_xy
=
h
->
mb2b_xy
[
top_xy
]
+
3
*
b_stride
;
...
@@ -813,7 +813,7 @@ static void av_unused decode_mb_skip(H264Context *h, H264SliceContext *sl)
...
@@ -813,7 +813,7 @@ static void av_unused decode_mb_skip(H264Context *h, H264SliceContext *sl)
if
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_B
)
{
if
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_B
)
{
// just for fill_caches. pred_direct_motion will set the real mb_type
// just for fill_caches. pred_direct_motion will set the real mb_type
mb_type
|=
MB_TYPE_L0L1
|
MB_TYPE_DIRECT2
|
MB_TYPE_SKIP
;
mb_type
|=
MB_TYPE_L0L1
|
MB_TYPE_DIRECT2
|
MB_TYPE_SKIP
;
if
(
h
->
direct_spatial_mv_pred
)
{
if
(
sl
->
direct_spatial_mv_pred
)
{
fill_decode_neighbors
(
h
,
sl
,
mb_type
);
fill_decode_neighbors
(
h
,
sl
,
mb_type
);
fill_decode_caches
(
h
,
sl
,
mb_type
);
//FIXME check what is needed and what not ...
fill_decode_caches
(
h
,
sl
,
mb_type
);
//FIXME check what is needed and what not ...
}
}
...
...
libavcodec/h264_slice.c
View file @
066aafce
...
@@ -1646,7 +1646,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, H264Contex
...
@@ -1646,7 +1646,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, H264Contex
}
}
}
}
if
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_B
&&
!
h
->
direct_spatial_mv_pred
)
if
(
sl
->
slice_type_nos
==
AV_PICTURE_TYPE_B
&&
!
sl
->
direct_spatial_mv_pred
)
ff_h264_direct_dist_scale_factor
(
h
);
ff_h264_direct_dist_scale_factor
(
h
);
ff_h264_direct_ref_list_init
(
h
,
sl
);
ff_h264_direct_ref_list_init
(
h
,
sl
);
...
@@ -1797,7 +1797,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, H264Contex
...
@@ -1797,7 +1797,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, H264Contex
h
->
slice_alpha_c0_offset
,
h
->
slice_beta_offset
,
h
->
slice_alpha_c0_offset
,
h
->
slice_beta_offset
,
sl
->
use_weight
,
sl
->
use_weight
,
sl
->
use_weight
==
1
&&
sl
->
use_weight_chroma
?
"c"
:
""
,
sl
->
use_weight
==
1
&&
sl
->
use_weight_chroma
?
"c"
:
""
,
sl
->
slice_type
==
AV_PICTURE_TYPE_B
?
(
h
->
direct_spatial_mv_pred
?
"SPAT"
:
"TEMP"
)
:
""
);
sl
->
slice_type
==
AV_PICTURE_TYPE_B
?
(
sl
->
direct_spatial_mv_pred
?
"SPAT"
:
"TEMP"
)
:
""
);
}
}
return
0
;
return
0
;
...
...
libavcodec/vaapi_h264.c
View file @
066aafce
...
@@ -330,7 +330,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
...
@@ -330,7 +330,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
slice_param
->
slice_data_bit_offset
=
get_bits_count
(
&
h
->
gb
)
+
8
;
/* bit buffer started beyond nal_unit_type */
slice_param
->
slice_data_bit_offset
=
get_bits_count
(
&
h
->
gb
)
+
8
;
/* bit buffer started beyond nal_unit_type */
slice_param
->
first_mb_in_slice
=
(
h
->
mb_y
>>
FIELD_OR_MBAFF_PICTURE
(
h
))
*
h
->
mb_width
+
h
->
mb_x
;
slice_param
->
first_mb_in_slice
=
(
h
->
mb_y
>>
FIELD_OR_MBAFF_PICTURE
(
h
))
*
h
->
mb_width
+
h
->
mb_x
;
slice_param
->
slice_type
=
ff_h264_get_slice_type
(
sl
);
slice_param
->
slice_type
=
ff_h264_get_slice_type
(
sl
);
slice_param
->
direct_spatial_mv_pred_flag
=
sl
->
slice_type
==
AV_PICTURE_TYPE_B
?
h
->
direct_spatial_mv_pred
:
0
;
slice_param
->
direct_spatial_mv_pred_flag
=
sl
->
slice_type
==
AV_PICTURE_TYPE_B
?
sl
->
direct_spatial_mv_pred
:
0
;
slice_param
->
num_ref_idx_l0_active_minus1
=
h
->
list_count
>
0
?
h
->
ref_count
[
0
]
-
1
:
0
;
slice_param
->
num_ref_idx_l0_active_minus1
=
h
->
list_count
>
0
?
h
->
ref_count
[
0
]
-
1
:
0
;
slice_param
->
num_ref_idx_l1_active_minus1
=
h
->
list_count
>
1
?
h
->
ref_count
[
1
]
-
1
:
0
;
slice_param
->
num_ref_idx_l1_active_minus1
=
h
->
list_count
>
1
?
h
->
ref_count
[
1
]
-
1
:
0
;
slice_param
->
cabac_init_idc
=
h
->
cabac_init_idc
;
slice_param
->
cabac_init_idc
=
h
->
cabac_init_idc
;
...
...
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