diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 13:34:30 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 13:34:33 +0100 |
commit | acd6b407c3cebc6dda899820d65e75ad1d75eb63 (patch) | |
tree | 586479a5212830e176b2146234adc4f195545e4b | |
parent | c27f53b9fbcd8f638afecc637ef844b612cc39be (diff) | |
parent | 06789ad3b71296a9e2fbd0278632d97a5d9af8d7 (diff) | |
download | ffmpeg-acd6b407c3cebc6dda899820d65e75ad1d75eb63.tar.gz |
Merge commit '06789ad3b71296a9e2fbd0278632d97a5d9af8d7'
* commit '06789ad3b71296a9e2fbd0278632d97a5d9af8d7':
h264: move qp_thresh into the per-slice context
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264.h | 3 | ||||
-rw-r--r-- | libavcodec/h264_slice.c | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 84611f9005..a7b8f133b0 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -338,6 +338,7 @@ typedef struct H264SliceContext { int qscale; int chroma_qp[2]; // QPc + int qp_thresh; ///< QP threshold to skip loopfilter // Weighted pred stuff int use_weight; @@ -375,8 +376,6 @@ typedef struct H264Context { int pixel_shift; ///< 0 for 8-bit H264, 1 for high-bit-depth H264 - int qp_thresh; ///< QP threshold to skip loopfilter - /* coded dimensions -- 16 * mb w/h */ int width, height; ptrdiff_t linesize, uvlinesize; diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 5ce4c28fed..6397b26372 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1940,7 +1940,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, H264Contex } } } - h->qp_thresh = 15 - + sl->qp_thresh = 15 - FFMIN(h->slice_alpha_c0_offset, h->slice_beta_offset) - FFMAX3(0, h->pps.chroma_qp_index_offset[0], @@ -2124,7 +2124,7 @@ static av_always_inline void fill_filter_caches_inter(H264Context *h, * * @return non zero if the loop filter can be skipped */ -static int fill_filter_caches(H264Context *h, int mb_type) +static int fill_filter_caches(H264Context *h, H264SliceContext *sl, int mb_type) { const int mb_xy = h->mb_xy; int top_xy, left_xy[LEFT_MBS]; @@ -2160,7 +2160,7 @@ static int fill_filter_caches(H264Context *h, int mb_type) /* For sufficiently low qp, filtering wouldn't do anything. * This is a conservative estimate: could also check beta_offset * and more accurate chroma_qp. */ - int qp_thresh = h->qp_thresh; // FIXME strictly we should store qp_thresh for each mb of a slice + int qp_thresh = sl->qp_thresh; // FIXME strictly we should store qp_thresh for each mb of a slice int qp = h->cur_pic.qscale_table[mb_xy]; if (qp <= qp_thresh && (left_xy[LTOP] < 0 || @@ -2317,7 +2317,7 @@ static void loop_filter(H264Context *h, H264SliceContext *sl, int start_x, int e } backup_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 0); - if (fill_filter_caches(h, mb_type)) + if (fill_filter_caches(h, sl, mb_type)) continue; sl->chroma_qp[0] = get_chroma_qp(h, 0, h->cur_pic.qscale_table[mb_xy]); sl->chroma_qp[1] = get_chroma_qp(h, 1, h->cur_pic.qscale_table[mb_xy]); |