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
5c8280c3
Commit
5c8280c3
authored
Jan 17, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: move last_qscale_diff into the per-slice context
parent
e7226984
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
h264.h
libavcodec/h264.h
+1
-1
h264_cabac.c
libavcodec/h264_cabac.c
+6
-6
h264_slice.c
libavcodec/h264_slice.c
+1
-1
No files found.
libavcodec/h264.h
View file @
5c8280c3
...
...
@@ -307,6 +307,7 @@ typedef struct H264SliceContext {
int
qscale
;
int
chroma_qp
[
2
];
// QPc
int
qp_thresh
;
///< QP threshold to skip loopfilter
int
last_qscale_diff
;
// Weighted pred stuff
int
use_weight
;
...
...
@@ -491,7 +492,6 @@ typedef struct H264Context {
/* chroma_pred_mode for i4x4 or i16x16, else 0 */
uint8_t
*
chroma_pred_mode_table
;
int
last_qscale_diff
;
uint8_t
(
*
mvd_table
[
2
])[
2
];
DECLARE_ALIGNED
(
16
,
uint8_t
,
mvd_cache
)[
2
][
5
*
8
][
2
];
uint8_t
*
direct_table
;
...
...
libavcodec/h264_cabac.c
View file @
5c8280c3
...
...
@@ -1937,7 +1937,7 @@ int ff_h264_decode_mb_cabac(H264Context *h, H264SliceContext *sl)
h
->
cbp_table
[
mb_xy
]
=
0
;
h
->
chroma_pred_mode_table
[
mb_xy
]
=
0
;
h
->
last_qscale_diff
=
0
;
sl
->
last_qscale_diff
=
0
;
return
0
;
...
...
@@ -2050,7 +2050,7 @@ decode_intra_mb:
// All coeffs are present
memset
(
h
->
non_zero_count
[
mb_xy
],
16
,
48
);
h
->
cur_pic
.
mb_type
[
mb_xy
]
=
mb_type
;
h
->
last_qscale_diff
=
0
;
sl
->
last_qscale_diff
=
0
;
return
0
;
}
...
...
@@ -2358,7 +2358,7 @@ decode_intra_mb:
}
// decode_cabac_mb_dqp
if
(
get_cabac_noinline
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
60
+
(
h
->
last_qscale_diff
!=
0
)])){
if
(
get_cabac_noinline
(
&
sl
->
cabac
,
&
sl
->
cabac_state
[
60
+
(
sl
->
last_qscale_diff
!=
0
)])){
int
val
=
1
;
int
ctx
=
2
;
const
int
max_qp
=
51
+
6
*
(
h
->
sps
.
bit_depth_luma
-
8
);
...
...
@@ -2376,7 +2376,7 @@ decode_intra_mb:
val
=
(
val
+
1
)
>>
1
;
else
val
=
-
((
val
+
1
)
>>
1
);
h
->
last_qscale_diff
=
val
;
sl
->
last_qscale_diff
=
val
;
sl
->
qscale
+=
val
;
if
(((
unsigned
)
sl
->
qscale
)
>
max_qp
){
if
(
sl
->
qscale
<
0
)
sl
->
qscale
+=
max_qp
+
1
;
...
...
@@ -2385,7 +2385,7 @@ decode_intra_mb:
sl
->
chroma_qp
[
0
]
=
get_chroma_qp
(
h
,
0
,
sl
->
qscale
);
sl
->
chroma_qp
[
1
]
=
get_chroma_qp
(
h
,
1
,
sl
->
qscale
);
}
else
h
->
last_qscale_diff
=
0
;
sl
->
last_qscale_diff
=
0
;
decode_cabac_luma_residual
(
h
,
sl
,
scan
,
scan8x8
,
pixel_shift
,
mb_type
,
cbp
,
0
);
if
(
CHROMA444
(
h
))
{
...
...
@@ -2442,7 +2442,7 @@ decode_intra_mb:
fill_rectangle
(
&
sl
->
non_zero_count_cache
[
scan8
[
0
]],
4
,
4
,
8
,
0
,
1
);
fill_rectangle
(
&
sl
->
non_zero_count_cache
[
scan8
[
16
]],
4
,
4
,
8
,
0
,
1
);
fill_rectangle
(
&
sl
->
non_zero_count_cache
[
scan8
[
32
]],
4
,
4
,
8
,
0
,
1
);
h
->
last_qscale_diff
=
0
;
sl
->
last_qscale_diff
=
0
;
}
h
->
cur_pic
.
qscale_table
[
mb_xy
]
=
sl
->
qscale
;
...
...
libavcodec/h264_slice.c
View file @
5c8280c3
...
...
@@ -1660,7 +1660,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, H264Contex
h
->
cabac_init_idc
=
tmp
;
}
h
->
last_qscale_diff
=
0
;
sl
->
last_qscale_diff
=
0
;
tmp
=
h
->
pps
.
init_qp
+
get_se_golomb
(
&
h
->
gb
);
if
(
tmp
>
51
+
6
*
(
h
->
sps
.
bit_depth_luma
-
8
))
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"QP %u out of range
\n
"
,
tmp
);
...
...
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