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
cc615d2c
Commit
cc615d2c
authored
Aug 05, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indent
Originally committed as revision 14619 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
d00eac6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
63 deletions
+63
-63
h264.c
libavcodec/h264.c
+63
-63
No files found.
libavcodec/h264.c
View file @
cc615d2c
...
@@ -1011,18 +1011,18 @@ static inline void pred_direct_motion(H264Context * const h, int *mb_type){
...
@@ -1011,18 +1011,18 @@ static inline void pred_direct_motion(H264Context * const h, int *mb_type){
single_col
:
single_col
:
mb_type_col
[
0
]
=
mb_type_col
[
0
]
=
mb_type_col
[
1
]
=
h
->
ref_list
[
1
][
0
].
mb_type
[
mb_xy
];
mb_type_col
[
1
]
=
h
->
ref_list
[
1
][
0
].
mb_type
[
mb_xy
];
if
(
IS_8X8
(
mb_type_col
[
0
])
&&
!
h
->
sps
.
direct_8x8_inference_flag
){
if
(
IS_8X8
(
mb_type_col
[
0
])
&&
!
h
->
sps
.
direct_8x8_inference_flag
){
/* FIXME save sub mb types from previous frames (or derive from MVs)
/* FIXME save sub mb types from previous frames (or derive from MVs)
* so we know exactly what block size to use */
* so we know exactly what block size to use */
sub_mb_type
=
MB_TYPE_8x8
|
MB_TYPE_P0L0
|
MB_TYPE_P0L1
|
MB_TYPE_DIRECT2
;
/* B_SUB_4x4 */
sub_mb_type
=
MB_TYPE_8x8
|
MB_TYPE_P0L0
|
MB_TYPE_P0L1
|
MB_TYPE_DIRECT2
;
/* B_SUB_4x4 */
*
mb_type
|=
MB_TYPE_8x8
|
MB_TYPE_L0L1
;
*
mb_type
|=
MB_TYPE_8x8
|
MB_TYPE_L0L1
;
}
else
if
(
!
is_b8x8
&&
(
mb_type_col
[
0
]
&
MB_TYPE_16x16_OR_INTRA
)){
}
else
if
(
!
is_b8x8
&&
(
mb_type_col
[
0
]
&
MB_TYPE_16x16_OR_INTRA
)){
sub_mb_type
=
MB_TYPE_16x16
|
MB_TYPE_P0L0
|
MB_TYPE_P0L1
|
MB_TYPE_DIRECT2
;
/* B_SUB_8x8 */
sub_mb_type
=
MB_TYPE_16x16
|
MB_TYPE_P0L0
|
MB_TYPE_P0L1
|
MB_TYPE_DIRECT2
;
/* B_SUB_8x8 */
*
mb_type
|=
MB_TYPE_16x16
|
MB_TYPE_P0L0
|
MB_TYPE_P0L1
|
MB_TYPE_DIRECT2
;
/* B_16x16 */
*
mb_type
|=
MB_TYPE_16x16
|
MB_TYPE_P0L0
|
MB_TYPE_P0L1
|
MB_TYPE_DIRECT2
;
/* B_16x16 */
}
else
{
}
else
{
sub_mb_type
=
MB_TYPE_16x16
|
MB_TYPE_P0L0
|
MB_TYPE_P0L1
|
MB_TYPE_DIRECT2
;
/* B_SUB_8x8 */
sub_mb_type
=
MB_TYPE_16x16
|
MB_TYPE_P0L0
|
MB_TYPE_P0L1
|
MB_TYPE_DIRECT2
;
/* B_SUB_8x8 */
*
mb_type
|=
MB_TYPE_8x8
|
MB_TYPE_L0L1
;
*
mb_type
|=
MB_TYPE_8x8
|
MB_TYPE_L0L1
;
}
}
}
}
}
}
...
@@ -1166,64 +1166,64 @@ single_col:
...
@@ -1166,64 +1166,64 @@ single_col:
const
int
*
map_col_to_list0
[
2
]
=
{
h
->
map_col_to_list0
[
0
],
h
->
map_col_to_list0
[
1
]};
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
=
h
->
dist_scale_factor
;
if
(
FRAME_MBAFF
&&
IS_INTERLACED
(
*
mb_type
)){
if
(
FRAME_MBAFF
&&
IS_INTERLACED
(
*
mb_type
)){
map_col_to_list0
[
0
]
=
h
->
map_col_to_list0_field
[
0
];
map_col_to_list0
[
0
]
=
h
->
map_col_to_list0_field
[
0
];
map_col_to_list0
[
1
]
=
h
->
map_col_to_list0_field
[
1
];
map_col_to_list0
[
1
]
=
h
->
map_col_to_list0_field
[
1
];
dist_scale_factor
=
h
->
dist_scale_factor_field
;
dist_scale_factor
=
h
->
dist_scale_factor_field
;
}
if
(
IS_INTERLACED
(
*
mb_type
)
!=
IS_INTERLACED
(
mb_type_col
[
0
])){
/* FIXME assumes direct_8x8_inference == 1 */
int
y_shift
;
int
ref_shift
;
if
(
IS_INTERLACED
(
*
mb_type
)){
/* frame to field scaling */
y_shift
=
0
;
ref_shift
=
FRAME_MBAFF
?
0
:
1
;
}
else
{
y_shift
=
2
;
ref_shift
=
FRAME_MBAFF
?
2
:
1
;
}
}
if
(
IS_INTERLACED
(
*
mb_type
)
!=
IS_INTERLACED
(
mb_type_col
[
0
])){
/* FIXME assumes direct_8x8_inference == 1 */
int
y_shift
;
int
ref_shift
;
if
(
IS_INTERLACED
(
*
mb_type
)){
for
(
i8
=
0
;
i8
<
4
;
i8
++
){
/* frame to field scaling */
const
int
x8
=
i8
&
1
;
y_shift
=
0
;
const
int
y8
=
i8
>>
1
;
ref_shift
=
FRAME_MBAFF
?
0
:
1
;
int
ref0
,
scale
;
}
else
{
const
int16_t
(
*
l1mv
)[
2
]
=
l1mv0
;
y_shift
=
2
;
ref_shift
=
FRAME_MBAFF
?
2
:
1
;
}
for
(
i8
=
0
;
i8
<
4
;
i8
++
){
if
(
is_b8x8
&&
!
IS_DIRECT
(
h
->
sub_mb_type
[
i8
]))
const
int
x8
=
i8
&
1
;
continue
;
const
int
y8
=
i8
>>
1
;
h
->
sub_mb_type
[
i8
]
=
sub_mb_type
;
int
ref0
,
scale
;
const
int16_t
(
*
l1mv
)[
2
]
=
l1mv0
;
if
(
is_b8x8
&&
!
IS_DIRECT
(
h
->
sub_mb_type
[
i8
]))
continue
;
h
->
sub_mb_type
[
i8
]
=
sub_mb_type
;
fill_rectangle
(
&
h
->
ref_cache
[
1
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
0
,
1
);
if
(
IS_INTRA
(
mb_type_col
[
y8
])){
fill_rectangle
(
&
h
->
ref_cache
[
0
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
0
,
1
);
fill_rectangle
(
&
h
->
mv_cache
[
0
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
0
,
4
);
fill_rectangle
(
&
h
->
mv_cache
[
1
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
0
,
4
);
continue
;
}
ref0
=
l1ref0
[
x8
+
y8
*
b8_stride
];
fill_rectangle
(
&
h
->
ref_cache
[
1
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
0
,
1
);
if
(
ref0
>=
0
)
if
(
IS_INTRA
(
mb_type_col
[
y8
])){
ref0
=
map_col_to_list0
[
0
][
ref0
*
2
>>
ref_shift
];
fill_rectangle
(
&
h
->
ref_cache
[
0
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
0
,
1
);
else
{
fill_rectangle
(
&
h
->
mv_cache
[
0
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
0
,
4
);
ref0
=
map_col_to_list0
[
1
][
l1ref1
[
x8
+
y8
*
b8_stride
]
*
2
>>
ref_shift
];
fill_rectangle
(
&
h
->
mv_cache
[
1
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
0
,
4
);
l1mv
=
l1mv1
;
continue
;
}
}
scale
=
dist_scale_factor
[
ref0
];
fill_rectangle
(
&
h
->
ref_cache
[
0
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
ref0
,
1
);
{
ref0
=
l1ref0
[
x8
+
y8
*
b8_stride
];
const
int16_t
*
mv_col
=
l1mv
[
x8
*
3
+
y8
*
b4_stride
];
if
(
ref0
>=
0
)
int
my_col
=
(
mv_col
[
1
]
<<
y_shift
)
/
2
;
ref0
=
map_col_to_list0
[
0
][
ref0
*
2
>>
ref_shift
];
int
mx
=
(
scale
*
mv_col
[
0
]
+
128
)
>>
8
;
else
{
int
my
=
(
scale
*
my_col
+
128
)
>>
8
;
ref0
=
map_col_to_list0
[
1
][
l1ref1
[
x8
+
y8
*
b8_stride
]
*
2
>>
ref_shift
];
fill_rectangle
(
&
h
->
mv_cache
[
0
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
pack16to32
(
mx
,
my
),
4
);
l1mv
=
l1mv1
;
fill_rectangle
(
&
h
->
mv_cache
[
1
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
pack16to32
(
mx
-
mv_col
[
0
],
my
-
my_col
),
4
);
}
}
scale
=
dist_scale_factor
[
ref0
];
fill_rectangle
(
&
h
->
ref_cache
[
0
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
ref0
,
1
);
{
const
int16_t
*
mv_col
=
l1mv
[
x8
*
3
+
y8
*
b4_stride
];
int
my_col
=
(
mv_col
[
1
]
<<
y_shift
)
/
2
;
int
mx
=
(
scale
*
mv_col
[
0
]
+
128
)
>>
8
;
int
my
=
(
scale
*
my_col
+
128
)
>>
8
;
fill_rectangle
(
&
h
->
mv_cache
[
0
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
pack16to32
(
mx
,
my
),
4
);
fill_rectangle
(
&
h
->
mv_cache
[
1
][
scan8
[
i8
*
4
]],
2
,
2
,
8
,
pack16to32
(
mx
-
mv_col
[
0
],
my
-
my_col
),
4
);
}
}
return
;
}
}
return
;
}
/* one-to-one mv scaling */
/* one-to-one mv scaling */
...
...
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