Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
be69f0a8
Commit
be69f0a8
authored
10 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
h264: move col_{parity,fieldoff} into the per-slice context
parent
066aafce
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavcodec/h264.h
+2
-2
2 additions, 2 deletions
libavcodec/h264.h
libavcodec/h264_direct.c
+13
-13
13 additions, 13 deletions
libavcodec/h264_direct.c
with
15 additions
and
15 deletions
libavcodec/h264.h
+
2
−
2
View file @
be69f0a8
...
@@ -356,6 +356,8 @@ typedef struct H264SliceContext {
...
@@ -356,6 +356,8 @@ typedef struct H264SliceContext {
int
neighbor_transform_size
;
int
neighbor_transform_size
;
int
direct_spatial_mv_pred
;
int
direct_spatial_mv_pred
;
int
col_parity
;
int
col_fieldoff
;
/**
/**
* non zero coeff count cache.
* non zero coeff count cache.
...
@@ -442,8 +444,6 @@ typedef struct H264Context {
...
@@ -442,8 +444,6 @@ typedef struct H264Context {
int
picture_structure
;
int
picture_structure
;
int
first_field
;
int
first_field
;
int
col_parity
;
int
col_fieldoff
;
int
dist_scale_factor
[
32
];
int
dist_scale_factor
[
32
];
int
dist_scale_factor_field
[
2
][
32
];
int
dist_scale_factor_field
[
2
][
32
];
int
map_col_to_list0
[
2
][
16
+
32
];
int
map_col_to_list0
[
2
][
16
+
32
];
...
...
This diff is collapsed.
Click to expand it.
libavcodec/h264_direct.c
+
13
−
13
View file @
be69f0a8
...
@@ -126,18 +126,18 @@ void ff_h264_direct_ref_list_init(H264Context *const h, H264SliceContext *sl)
...
@@ -126,18 +126,18 @@ void ff_h264_direct_ref_list_init(H264Context *const h, H264SliceContext *sl)
cur
->
mbaff
=
FRAME_MBAFF
(
h
);
cur
->
mbaff
=
FRAME_MBAFF
(
h
);
h
->
col_fieldoff
=
0
;
sl
->
col_fieldoff
=
0
;
if
(
h
->
picture_structure
==
PICT_FRAME
)
{
if
(
h
->
picture_structure
==
PICT_FRAME
)
{
int
cur_poc
=
h
->
cur_pic_ptr
->
poc
;
int
cur_poc
=
h
->
cur_pic_ptr
->
poc
;
int
*
col_poc
=
h
->
ref_list
[
1
]
->
field_poc
;
int
*
col_poc
=
h
->
ref_list
[
1
]
->
field_poc
;
h
->
col_parity
=
(
FFABS
(
col_poc
[
0
]
-
cur_poc
)
>=
sl
->
col_parity
=
(
FFABS
(
col_poc
[
0
]
-
cur_poc
)
>=
FFABS
(
col_poc
[
1
]
-
cur_poc
));
FFABS
(
col_poc
[
1
]
-
cur_poc
));
ref1sidx
=
ref1sidx
=
sidx
=
h
->
col_parity
;
sidx
=
sl
->
col_parity
;
// FL -> FL & differ parity
// FL -> FL & differ parity
}
else
if
(
!
(
h
->
picture_structure
&
h
->
ref_list
[
1
][
0
].
reference
)
&&
}
else
if
(
!
(
h
->
picture_structure
&
h
->
ref_list
[
1
][
0
].
reference
)
&&
!
h
->
ref_list
[
1
][
0
].
mbaff
)
{
!
h
->
ref_list
[
1
][
0
].
mbaff
)
{
h
->
col_fieldoff
=
2
*
h
->
ref_list
[
1
][
0
].
reference
-
3
;
sl
->
col_fieldoff
=
2
*
h
->
ref_list
[
1
][
0
].
reference
-
3
;
}
}
if
(
sl
->
slice_type_nos
!=
AV_PICTURE_TYPE_B
||
sl
->
direct_spatial_mv_pred
)
if
(
sl
->
slice_type_nos
!=
AV_PICTURE_TYPE_B
||
sl
->
direct_spatial_mv_pred
)
...
@@ -259,13 +259,13 @@ static void pred_spatial_direct_motion(H264Context *const h, H264SliceContext *s
...
@@ -259,13 +259,13 @@ static void pred_spatial_direct_motion(H264Context *const h, H264SliceContext *s
if
(
IS_INTERLACED
(
h
->
ref_list
[
1
][
0
].
mb_type
[
mb_xy
]))
{
// AFL/AFR/FR/FL -> AFL/FL
if
(
IS_INTERLACED
(
h
->
ref_list
[
1
][
0
].
mb_type
[
mb_xy
]))
{
// AFL/AFR/FR/FL -> AFL/FL
if
(
!
IS_INTERLACED
(
*
mb_type
))
{
// AFR/FR -> AFL/FL
if
(
!
IS_INTERLACED
(
*
mb_type
))
{
// AFR/FR -> AFL/FL
mb_y
=
(
h
->
mb_y
&
~
1
)
+
h
->
col_parity
;
mb_y
=
(
h
->
mb_y
&
~
1
)
+
sl
->
col_parity
;
mb_xy
=
h
->
mb_x
+
mb_xy
=
h
->
mb_x
+
((
h
->
mb_y
&
~
1
)
+
h
->
col_parity
)
*
h
->
mb_stride
;
((
h
->
mb_y
&
~
1
)
+
sl
->
col_parity
)
*
h
->
mb_stride
;
b8_stride
=
0
;
b8_stride
=
0
;
}
else
{
}
else
{
mb_y
+=
h
->
col_fieldoff
;
mb_y
+=
sl
->
col_fieldoff
;
mb_xy
+=
h
->
mb_stride
*
h
->
col_fieldoff
;
// non-zero for FL -> FL & differ parity
mb_xy
+=
h
->
mb_stride
*
sl
->
col_fieldoff
;
// non-zero for FL -> FL & differ parity
}
}
goto
single_col
;
goto
single_col
;
}
else
{
// AFL/AFR/FR/FL -> AFR/FR
}
else
{
// AFL/AFR/FR/FL -> AFR/FR
...
@@ -477,13 +477,13 @@ static void pred_temp_direct_motion(H264Context *const h, H264SliceContext *sl,
...
@@ -477,13 +477,13 @@ static void pred_temp_direct_motion(H264Context *const h, H264SliceContext *sl,
if
(
IS_INTERLACED
(
h
->
ref_list
[
1
][
0
].
mb_type
[
mb_xy
]))
{
// AFL/AFR/FR/FL -> AFL/FL
if
(
IS_INTERLACED
(
h
->
ref_list
[
1
][
0
].
mb_type
[
mb_xy
]))
{
// AFL/AFR/FR/FL -> AFL/FL
if
(
!
IS_INTERLACED
(
*
mb_type
))
{
// AFR/FR -> AFL/FL
if
(
!
IS_INTERLACED
(
*
mb_type
))
{
// AFR/FR -> AFL/FL
mb_y
=
(
h
->
mb_y
&
~
1
)
+
h
->
col_parity
;
mb_y
=
(
h
->
mb_y
&
~
1
)
+
sl
->
col_parity
;
mb_xy
=
h
->
mb_x
+
mb_xy
=
h
->
mb_x
+
((
h
->
mb_y
&
~
1
)
+
h
->
col_parity
)
*
h
->
mb_stride
;
((
h
->
mb_y
&
~
1
)
+
sl
->
col_parity
)
*
h
->
mb_stride
;
b8_stride
=
0
;
b8_stride
=
0
;
}
else
{
}
else
{
mb_y
+=
h
->
col_fieldoff
;
mb_y
+=
sl
->
col_fieldoff
;
mb_xy
+=
h
->
mb_stride
*
h
->
col_fieldoff
;
// non-zero for FL -> FL & differ parity
mb_xy
+=
h
->
mb_stride
*
sl
->
col_fieldoff
;
// non-zero for FL -> FL & differ parity
}
}
goto
single_col
;
goto
single_col
;
}
else
{
// AFL/AFR/FR/FL -> AFR/FR
}
else
{
// AFL/AFR/FR/FL -> AFR/FR
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment