summaryrefslogtreecommitdiff
path: root/libavcodec/h264_loopfilter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-03-22 13:31:21 +0100
committerAnton Khirnov <anton@khirnov.net>2016-04-24 10:06:23 +0200
commit3176217c60ca7828712985092d9102d331ea4f3d (patch)
tree1124709788c4b1b3ec4da9cd8e204cc63039cc8f /libavcodec/h264_loopfilter.c
parent44d16df413878588659dd8901bba016b5a869fd1 (diff)
h264: decouple h264_ps from the h264 decoder
Make the SPS/PPS parsing independent of the H264Context, to allow decoupling the parser from the decoder. The change is modelled after the one done earlier for HEVC. Move the dequant buffers to the PPS to avoid complex checks whether they changed and an expensive copy for frame threads.
Diffstat (limited to 'libavcodec/h264_loopfilter.c')
-rw-r--r--libavcodec/h264_loopfilter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c
index ae93681246..fccfc66c1c 100644
--- a/libavcodec/h264_loopfilter.c
+++ b/libavcodec/h264_loopfilter.c
@@ -252,7 +252,7 @@ static av_always_inline void h264_filter_mb_fast_internal(const H264Context *h,
int left_type = sl->left_type[LTOP];
int top_type = sl->top_type;
- int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
+ int qp_bd_offset = 6 * (h->ps.sps->bit_depth_luma - 8);
int a = 52 + sl->slice_alpha_c0_offset - qp_bd_offset;
int b = 52 + sl->slice_beta_offset - qp_bd_offset;
@@ -422,7 +422,7 @@ void ff_h264_filter_mb_fast(const H264Context *h, H264SliceContext *sl,
unsigned int linesize, unsigned int uvlinesize)
{
assert(!FRAME_MBAFF(h));
- if(!h->h264dsp.h264_loop_filter_strength || h->pps.chroma_qp_diff) {
+ if(!h->h264dsp.h264_loop_filter_strength || h->ps.pps->chroma_qp_diff) {
ff_h264_filter_mb(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize);
return;
}
@@ -722,7 +722,7 @@ void ff_h264_filter_mb(const H264Context *h, H264SliceContext *sl,
const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4;
int first_vertical_edge_done = 0;
int chroma = !(CONFIG_GRAY && (h->flags & AV_CODEC_FLAG_GRAY));
- int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
+ int qp_bd_offset = 6 * (h->ps.sps->bit_depth_luma - 8);
int a = 52 + sl->slice_alpha_c0_offset - qp_bd_offset;
int b = 52 + sl->slice_beta_offset - qp_bd_offset;
@@ -765,7 +765,7 @@ void ff_h264_filter_mb(const H264Context *h, H264SliceContext *sl,
bS[i] = 4;
else{
bS[i] = 1 + !!(sl->non_zero_count_cache[12+8*(i>>1)] |
- ((!h->pps.cabac && IS_8x8DCT(mbn_type)) ?
+ ((!h->ps.pps->cabac && IS_8x8DCT(mbn_type)) ?
(h->cbp_table[mbn_xy] & (((MB_FIELD(sl) ? (i&2) : (mb_y&1)) ? 8 : 2) << 12))
:
h->non_zero_count[mbn_xy][ off[i] ]));