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
ee0d774d
Commit
ee0d774d
authored
Jan 17, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: move dist_scale_factor[_field] into the per-slice context
parent
be69f0a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
h264.h
libavcodec/h264.h
+4
-3
h264_direct.c
libavcodec/h264_direct.c
+6
-5
h264_slice.c
libavcodec/h264_slice.c
+1
-1
No files found.
libavcodec/h264.h
View file @
ee0d774d
...
...
@@ -359,6 +359,9 @@ typedef struct H264SliceContext {
int
col_parity
;
int
col_fieldoff
;
int
dist_scale_factor
[
32
];
int
dist_scale_factor_field
[
2
][
32
];
/**
* non zero coeff count cache.
* is 64 if not available.
...
...
@@ -444,8 +447,6 @@ typedef struct H264Context {
int
picture_structure
;
int
first_field
;
int
dist_scale_factor
[
32
];
int
dist_scale_factor_field
[
2
][
32
];
int
map_col_to_list0
[
2
][
16
+
32
];
int
map_col_to_list0_field
[
2
][
2
][
16
+
32
];
...
...
@@ -821,7 +822,7 @@ void ff_h264_init_cabac_states(H264Context *h, H264SliceContext *sl);
void
h264_init_dequant_tables
(
H264Context
*
h
);
void
ff_h264_direct_dist_scale_factor
(
H264Context
*
const
h
);
void
ff_h264_direct_dist_scale_factor
(
H264Context
*
const
h
,
H264SliceContext
*
sl
);
void
ff_h264_direct_ref_list_init
(
H264Context
*
const
h
,
H264SliceContext
*
sl
);
void
ff_h264_pred_direct_motion
(
H264Context
*
const
h
,
H264SliceContext
*
sl
,
int
*
mb_type
);
...
...
libavcodec/h264_direct.c
View file @
ee0d774d
...
...
@@ -47,7 +47,8 @@ static int get_scale_factor(H264Context *const h, int poc, int poc1, int i)
}
}
void
ff_h264_direct_dist_scale_factor
(
H264Context
*
const
h
)
void
ff_h264_direct_dist_scale_factor
(
H264Context
*
const
h
,
H264SliceContext
*
sl
)
{
const
int
poc
=
FIELD_PICTURE
(
h
)
?
h
->
cur_pic_ptr
->
field_poc
[
h
->
picture_structure
==
PICT_BOTTOM_FIELD
]
:
h
->
cur_pic_ptr
->
poc
;
...
...
@@ -59,12 +60,12 @@ void ff_h264_direct_dist_scale_factor(H264Context *const h)
const
int
poc
=
h
->
cur_pic_ptr
->
field_poc
[
field
];
const
int
poc1
=
h
->
ref_list
[
1
][
0
].
field_poc
[
field
];
for
(
i
=
0
;
i
<
2
*
h
->
ref_count
[
0
];
i
++
)
h
->
dist_scale_factor_field
[
field
][
i
^
field
]
=
sl
->
dist_scale_factor_field
[
field
][
i
^
field
]
=
get_scale_factor
(
h
,
poc
,
poc1
,
i
+
16
);
}
for
(
i
=
0
;
i
<
h
->
ref_count
[
0
];
i
++
)
h
->
dist_scale_factor
[
i
]
=
get_scale_factor
(
h
,
poc
,
poc1
,
i
);
sl
->
dist_scale_factor
[
i
]
=
get_scale_factor
(
h
,
poc
,
poc1
,
i
);
}
static
void
fill_colmap
(
H264Context
*
h
,
int
map
[
2
][
16
+
32
],
int
list
,
...
...
@@ -555,13 +556,13 @@ single_col:
{
const
int
*
map_col_to_list0
[
2
]
=
{
h
->
map_col_to_list0
[
0
],
h
->
map_col_to_list0
[
1
]
};
const
int
*
dist_scale_factor
=
h
->
dist_scale_factor
;
const
int
*
dist_scale_factor
=
sl
->
dist_scale_factor
;
int
ref_offset
;
if
(
FRAME_MBAFF
(
h
)
&&
IS_INTERLACED
(
*
mb_type
))
{
map_col_to_list0
[
0
]
=
h
->
map_col_to_list0_field
[
h
->
mb_y
&
1
][
0
];
map_col_to_list0
[
1
]
=
h
->
map_col_to_list0_field
[
h
->
mb_y
&
1
][
1
];
dist_scale_factor
=
h
->
dist_scale_factor_field
[
h
->
mb_y
&
1
];
dist_scale_factor
=
sl
->
dist_scale_factor_field
[
h
->
mb_y
&
1
];
}
ref_offset
=
(
h
->
ref_list
[
1
][
0
].
mbaff
<<
4
)
&
(
mb_type_col
[
0
]
>>
3
);
...
...
libavcodec/h264_slice.c
View file @
ee0d774d
...
...
@@ -1647,7 +1647,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, H264Contex
}
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
,
sl
);
ff_h264_direct_ref_list_init
(
h
,
sl
);
if
(
sl
->
slice_type_nos
!=
AV_PICTURE_TYPE_I
&&
h
->
pps
.
cabac
)
{
...
...
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