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
7bbc254d
Commit
7bbc254d
authored
Jan 17, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: move resync_mb_{x,y} into the per-slice context
parent
d4d9068c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
h264.h
libavcodec/h264.h
+2
-2
h264_slice.c
libavcodec/h264_slice.c
+12
-12
No files found.
libavcodec/h264.h
View file @
7bbc254d
...
...
@@ -358,6 +358,8 @@ typedef struct H264SliceContext {
int
mb_x
,
mb_y
;
int
mb_xy
;
int
resync_mb_x
;
int
resync_mb_y
;
int
mb_skip_run
;
int
is_complex
;
...
...
@@ -528,8 +530,6 @@ typedef struct H264Context {
int
x264_build
;
int
mb_y
;
int
resync_mb_x
;
int
resync_mb_y
;
int
mb_height
,
mb_width
;
int
mb_stride
;
int
mb_num
;
...
...
libavcodec/h264_slice.c
View file @
7bbc254d
...
...
@@ -1557,11 +1557,11 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, H264Contex
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"first_mb_in_slice overflow
\n
"
);
return
AVERROR_INVALIDDATA
;
}
h
->
resync_mb_x
=
sl
->
mb_x
=
first_mb_in_slice
%
h
->
mb_width
;
h
->
resync_mb_y
=
sl
->
mb_y
=
(
first_mb_in_slice
/
h
->
mb_width
)
<<
FIELD_OR_MBAFF_PICTURE
(
h
);
sl
->
resync_mb_x
=
sl
->
mb_x
=
first_mb_in_slice
%
h
->
mb_width
;
sl
->
resync_mb_y
=
sl
->
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
=
sl
->
mb_y
=
sl
->
mb_y
+
1
;
sl
->
resync_mb_y
=
sl
->
mb_y
=
sl
->
mb_y
+
1
;
assert
(
sl
->
mb_y
<
h
->
mb_height
);
if
(
h
->
picture_structure
==
PICT_FRAME
)
{
...
...
@@ -2224,7 +2224,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
if
((
h
->
workaround_bugs
&
FF_BUG_TRUNCATED
)
&&
sl
->
cabac
.
bytestream
>
sl
->
cabac
.
bytestream_end
+
2
)
{
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
sl
->
mb_x
-
1
,
er_add_slice
(
h
,
sl
,
sl
->
resync_mb_x
,
sl
->
resync_mb_y
,
sl
->
mb_x
-
1
,
sl
->
mb_y
,
ER_MB_END
);
if
(
sl
->
mb_x
>=
lf_x_start
)
loop_filter
(
h
,
sl
,
lf_x_start
,
sl
->
mb_x
+
1
);
...
...
@@ -2235,7 +2235,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
"error while decoding MB %d %d, bytestream %td
\n
"
,
sl
->
mb_x
,
sl
->
mb_y
,
sl
->
cabac
.
bytestream_end
-
sl
->
cabac
.
bytestream
);
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
sl
->
mb_x
,
er_add_slice
(
h
,
sl
,
sl
->
resync_mb_x
,
sl
->
resync_mb_y
,
sl
->
mb_x
,
sl
->
mb_y
,
ER_MB_ERROR
);
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -2255,7 +2255,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
if
(
eos
||
sl
->
mb_y
>=
h
->
mb_height
)
{
tprintf
(
h
->
avctx
,
"slice end %d %d
\n
"
,
get_bits_count
(
&
h
->
gb
),
h
->
gb
.
size_in_bits
);
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
sl
->
mb_x
-
1
,
er_add_slice
(
h
,
sl
,
sl
->
resync_mb_x
,
sl
->
resync_mb_y
,
sl
->
mb_x
-
1
,
sl
->
mb_y
,
ER_MB_END
);
if
(
sl
->
mb_x
>
lf_x_start
)
loop_filter
(
h
,
sl
,
lf_x_start
,
sl
->
mb_x
);
...
...
@@ -2282,7 +2282,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
if
(
ret
<
0
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"error while decoding MB %d %d
\n
"
,
sl
->
mb_x
,
sl
->
mb_y
);
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
sl
->
mb_x
,
er_add_slice
(
h
,
sl
,
sl
->
resync_mb_x
,
sl
->
resync_mb_y
,
sl
->
mb_x
,
sl
->
mb_y
,
ER_MB_ERROR
);
return
ret
;
}
...
...
@@ -2302,12 +2302,12 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
get_bits_count
(
&
h
->
gb
),
h
->
gb
.
size_in_bits
);
if
(
get_bits_left
(
&
h
->
gb
)
==
0
)
{
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
er_add_slice
(
h
,
sl
,
sl
->
resync_mb_x
,
sl
->
resync_mb_y
,
sl
->
mb_x
-
1
,
sl
->
mb_y
,
ER_MB_END
);
return
0
;
}
else
{
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
er_add_slice
(
h
,
sl
,
sl
->
resync_mb_x
,
sl
->
resync_mb_y
,
sl
->
mb_x
-
1
,
sl
->
mb_y
,
ER_MB_END
);
return
AVERROR_INVALIDDATA
;
...
...
@@ -2320,14 +2320,14 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
get_bits_count
(
&
h
->
gb
),
h
->
gb
.
size_in_bits
);
if
(
get_bits_left
(
&
h
->
gb
)
==
0
)
{
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
er_add_slice
(
h
,
sl
,
sl
->
resync_mb_x
,
sl
->
resync_mb_y
,
sl
->
mb_x
-
1
,
sl
->
mb_y
,
ER_MB_END
);
if
(
sl
->
mb_x
>
lf_x_start
)
loop_filter
(
h
,
sl
,
lf_x_start
,
sl
->
mb_x
);
return
0
;
}
else
{
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
sl
->
mb_x
,
er_add_slice
(
h
,
sl
,
sl
->
resync_mb_x
,
sl
->
resync_mb_y
,
sl
->
mb_x
,
sl
->
mb_y
,
ER_MB_ERROR
);
return
AVERROR_INVALIDDATA
;
...
...
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