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
30da98ad
Commit
30da98ad
authored
Jan 17, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: move cabac[_state] into the per-slice context
parent
bf03a878
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
102 deletions
+108
-102
h264.h
libavcodec/h264.h
+6
-6
h264_cabac.c
libavcodec/h264_cabac.c
+97
-91
h264_slice.c
libavcodec/h264_slice.c
+5
-5
No files found.
libavcodec/h264.h
View file @
30da98ad
...
...
@@ -396,6 +396,12 @@ typedef struct H264SliceContext {
///< as mb is addressed by scantable[i] and scantable is uint8_t we can either
///< check that i is not too large or ensure that there is some unused stuff after mb
int16_t
mb_padding
[
256
*
2
];
/**
* Cabac
*/
CABACContext
cabac
;
uint8_t
cabac_state
[
1024
];
}
H264SliceContext
;
/**
...
...
@@ -476,12 +482,6 @@ typedef struct H264Context {
GetBitContext
*
intra_gb_ptr
;
GetBitContext
*
inter_gb_ptr
;
/**
* Cabac
*/
CABACContext
cabac
;
uint8_t
cabac_state
[
1024
];
/* 0x100 -> non null luma_dc, 0x80/0x40 -> non null chroma_dc (cb/cr), 0x?0 -> chroma_cbp(0, 1, 2), 0x0? luma_cbp */
uint16_t
*
cbp_table
;
int
cbp
;
...
...
libavcodec/h264_cabac.c
View file @
30da98ad
This diff is collapsed.
Click to expand it.
libavcodec/h264_slice.c
View file @
30da98ad
...
...
@@ -2194,7 +2194,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
align_get_bits
(
&
h
->
gb
);
/* init cabac */
ff_init_cabac_decoder
(
&
h
->
cabac
,
ff_init_cabac_decoder
(
&
sl
->
cabac
,
h
->
gb
.
buffer
+
get_bits_count
(
&
h
->
gb
)
/
8
,
(
get_bits_left
(
&
h
->
gb
)
+
7
)
/
8
);
...
...
@@ -2219,21 +2219,21 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
ff_h264_hl_decode_mb
(
h
,
sl
);
h
->
mb_y
--
;
}
eos
=
get_cabac_terminate
(
&
h
->
cabac
);
eos
=
get_cabac_terminate
(
&
sl
->
cabac
);
if
((
h
->
workaround_bugs
&
FF_BUG_TRUNCATED
)
&&
h
->
cabac
.
bytestream
>
h
->
cabac
.
bytestream_end
+
2
)
{
sl
->
cabac
.
bytestream
>
sl
->
cabac
.
bytestream_end
+
2
)
{
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
h
->
mb_x
-
1
,
h
->
mb_y
,
ER_MB_END
);
if
(
h
->
mb_x
>=
lf_x_start
)
loop_filter
(
h
,
sl
,
lf_x_start
,
h
->
mb_x
+
1
);
return
0
;
}
if
(
ret
<
0
||
h
->
cabac
.
bytestream
>
h
->
cabac
.
bytestream_end
+
2
)
{
if
(
ret
<
0
||
sl
->
cabac
.
bytestream
>
sl
->
cabac
.
bytestream_end
+
2
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"error while decoding MB %d %d, bytestream %td
\n
"
,
h
->
mb_x
,
h
->
mb_y
,
h
->
cabac
.
bytestream_end
-
h
->
cabac
.
bytestream
);
sl
->
cabac
.
bytestream_end
-
sl
->
cabac
.
bytestream
);
er_add_slice
(
h
,
sl
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
h
->
mb_x
,
h
->
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