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
cab8c5f8
Commit
cab8c5f8
authored
Aug 11, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: do not reinitialize the global cabac tables at each slice header
parent
e8804186
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
cabac.c
libavcodec/cabac.c
+6
-0
h264.c
libavcodec/h264.c
+2
-1
No files found.
libavcodec/cabac.c
View file @
cab8c5f8
...
@@ -137,6 +137,10 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
...
@@ -137,6 +137,10 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
void
ff_init_cabac_states
(
void
)
void
ff_init_cabac_states
(
void
)
{
{
int
i
,
j
;
int
i
,
j
;
static
int
initialized
=
0
;
if
(
initialized
)
return
;
for
(
i
=
0
;
i
<
64
;
i
++
){
for
(
i
=
0
;
i
<
64
;
i
++
){
for
(
j
=
0
;
j
<
4
;
j
++
){
//FIXME check if this is worth the 1 shift we save
for
(
j
=
0
;
j
<
4
;
j
++
){
//FIXME check if this is worth the 1 shift we save
...
@@ -158,4 +162,6 @@ void ff_init_cabac_states(void)
...
@@ -158,4 +162,6 @@ void ff_init_cabac_states(void)
for
(
i
=
0
;
i
<
63
;
i
++
){
for
(
i
=
0
;
i
<
63
;
i
++
){
ff_h264_last_coeff_flag_offset_8x8
[
i
]
=
last_coeff_flag_offset_8x8
[
i
];
ff_h264_last_coeff_flag_offset_8x8
[
i
]
=
last_coeff_flag_offset_8x8
[
i
];
}
}
initialized
=
1
;
}
}
libavcodec/h264.c
View file @
cab8c5f8
...
@@ -1548,6 +1548,8 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
...
@@ -1548,6 +1548,8 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
ff_h264_decode_init_vlc
();
ff_h264_decode_init_vlc
();
ff_init_cabac_states
();
h
->
pixel_shift
=
0
;
h
->
pixel_shift
=
0
;
h
->
sps
.
bit_depth_luma
=
avctx
->
bits_per_raw_sample
=
8
;
h
->
sps
.
bit_depth_luma
=
avctx
->
bits_per_raw_sample
=
8
;
...
@@ -4244,7 +4246,6 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
...
@@ -4244,7 +4246,6 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
align_get_bits
(
&
h
->
gb
);
align_get_bits
(
&
h
->
gb
);
/* init cabac */
/* init cabac */
ff_init_cabac_states
();
ff_init_cabac_decoder
(
&
h
->
cabac
,
ff_init_cabac_decoder
(
&
h
->
cabac
,
h
->
gb
.
buffer
+
get_bits_count
(
&
h
->
gb
)
/
8
,
h
->
gb
.
buffer
+
get_bits_count
(
&
h
->
gb
)
/
8
,
(
get_bits_left
(
&
h
->
gb
)
+
7
)
/
8
);
(
get_bits_left
(
&
h
->
gb
)
+
7
)
/
8
);
...
...
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