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
a6931d8e
Commit
a6931d8e
authored
Mar 09, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: add a parameter to the FIELD_OR_MBAFF_PICTURE macro.
This way it does not look like a constant.
parent
7fa00653
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
dxva2_h264.c
libavcodec/dxva2_h264.c
+1
-1
h264.c
libavcodec/h264.c
+6
-6
h264.h
libavcodec/h264.h
+1
-1
vaapi_h264.c
libavcodec/vaapi_h264.c
+1
-1
No files found.
libavcodec/dxva2_h264.c
View file @
a6931d8e
...
...
@@ -206,7 +206,7 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
slice
->
SliceBytesInBuffer
=
size
;
slice
->
wBadSliceChopping
=
0
;
slice
->
first_mb_in_slice
=
(
h
->
mb_y
>>
FIELD_OR_MBAFF_PICTURE
)
*
h
->
mb_width
+
h
->
mb_x
;
slice
->
first_mb_in_slice
=
(
h
->
mb_y
>>
FIELD_OR_MBAFF_PICTURE
(
h
)
)
*
h
->
mb_width
+
h
->
mb_x
;
slice
->
NumMbsForSlice
=
0
;
/* XXX it is set once we have all slices */
slice
->
BitOffsetToSliceData
=
get_bits_count
(
&
h
->
gb
);
slice
->
slice_type
=
ff_h264_get_slice_type
(
h
);
...
...
libavcodec/h264.c
View file @
a6931d8e
...
...
@@ -1862,7 +1862,7 @@ static void decode_postinit(H264Context *h, int setup_finished)
break
;
case
SEI_PIC_STRUCT_TOP_BOTTOM
:
case
SEI_PIC_STRUCT_BOTTOM_TOP
:
if
(
FIELD_OR_MBAFF_PICTURE
)
if
(
FIELD_OR_MBAFF_PICTURE
(
h
)
)
cur
->
f
.
interlaced_frame
=
1
;
else
// try to flag soft telecine progressive
...
...
@@ -1888,7 +1888,7 @@ static void decode_postinit(H264Context *h, int setup_finished)
cur
->
f
.
interlaced_frame
=
(
h
->
sei_ct_type
&
(
1
<<
1
))
!=
0
;
}
else
{
/* Derive interlacing flag from used decoding process. */
cur
->
f
.
interlaced_frame
=
FIELD_OR_MBAFF_PICTURE
;
cur
->
f
.
interlaced_frame
=
FIELD_OR_MBAFF_PICTURE
(
h
)
;
}
h
->
prev_interlaced_frame
=
cur
->
f
.
interlaced_frame
;
...
...
@@ -3448,13 +3448,13 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
h
->
cur_pic_ptr
->
frame_num
=
h
->
frame_num
;
// FIXME frame_num cleanup
assert
(
h
->
mb_num
==
h
->
mb_width
*
h
->
mb_height
);
if
(
first_mb_in_slice
<<
FIELD_OR_MBAFF_PICTURE
>=
h
->
mb_num
||
if
(
first_mb_in_slice
<<
FIELD_OR_MBAFF_PICTURE
(
h
)
>=
h
->
mb_num
||
first_mb_in_slice
>=
h
->
mb_num
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"first_mb_in_slice overflow
\n
"
);
return
-
1
;
}
h
->
resync_mb_x
=
h
->
mb_x
=
first_mb_in_slice
%
h
->
mb_width
;
h
->
resync_mb_y
=
h
->
mb_y
=
(
first_mb_in_slice
/
h
->
mb_width
)
<<
FIELD_OR_MBAFF_PICTURE
;
h
->
resync_mb_y
=
h
->
mb_y
=
(
first_mb_in_slice
/
h
->
mb_width
)
<<
FIELD_OR_MBAFF_PICTURE
(
h
)
;
if
(
h
->
picture_structure
==
PICT_BOTTOM_FIELD
)
h
->
resync_mb_y
=
h
->
mb_y
=
h
->
mb_y
+
1
;
assert
(
h
->
mb_y
<
h
->
mb_height
);
...
...
@@ -4163,7 +4163,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
h
->
mb_x
=
lf_x_start
=
0
;
decode_finish_row
(
h
);
++
h
->
mb_y
;
if
(
FIELD_OR_MBAFF_PICTURE
)
{
if
(
FIELD_OR_MBAFF_PICTURE
(
h
)
)
{
++
h
->
mb_y
;
if
(
FRAME_MBAFF
(
h
)
&&
h
->
mb_y
<
h
->
mb_height
)
predict_field_decoding_flag
(
h
);
...
...
@@ -4210,7 +4210,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
h
->
mb_x
=
lf_x_start
=
0
;
decode_finish_row
(
h
);
++
h
->
mb_y
;
if
(
FIELD_OR_MBAFF_PICTURE
)
{
if
(
FIELD_OR_MBAFF_PICTURE
(
h
)
)
{
++
h
->
mb_y
;
if
(
FRAME_MBAFF
(
h
)
&&
h
->
mb_y
<
h
->
mb_height
)
predict_field_decoding_flag
(
h
);
...
...
libavcodec/h264.h
View file @
a6931d8e
...
...
@@ -79,7 +79,7 @@
#define LBOT 0
#define LEFT(i) 0
#endif
#define FIELD_OR_MBAFF_PICTURE (FRAME_MBAFF(h) || FIELD_PICTURE(h))
#define FIELD_OR_MBAFF_PICTURE
(h)
(FRAME_MBAFF(h) || FIELD_PICTURE(h))
#ifndef CABAC
#define CABAC h->pps.cabac
...
...
libavcodec/vaapi_h264.c
View file @
a6931d8e
...
...
@@ -324,7 +324,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
if
(
!
slice_param
)
return
-
1
;
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
->
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
(
h
);
slice_param
->
direct_spatial_mv_pred_flag
=
h
->
slice_type
==
AV_PICTURE_TYPE_B
?
h
->
direct_spatial_mv_pred
:
0
;
slice_param
->
num_ref_idx_l0_active_minus1
=
h
->
list_count
>
0
?
h
->
ref_count
[
0
]
-
1
:
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