diff options
author | Tim Walker <[email protected]> | 2016-03-29 23:09:36 +0200 |
---|---|---|
committer | Tim Walker <[email protected]> | 2016-03-31 01:05:16 +0200 |
commit | 0de684adbc17b445f93ed8e6f52951b44dc12063 (patch) | |
tree | 8397038b4ee55ad4dd2e6b2992b4cbba74135f71 | |
parent | 09e66a658c93268211303a4f426e1fd3324b5fa1 (diff) |
libhb: fix quality limits for high bit depth video encoders.
The lowest possible QP (and RF) depend on
the bit depth and can be lower than zero.
-rw-r--r-- | libhb/common.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/libhb/common.c b/libhb/common.c index 74209edfb..c3643daa1 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -1210,15 +1210,38 @@ void hb_video_quality_get_limits(uint32_t codec, float *low, float *high, switch (codec) { + /* + * H.264/H.265: *low + * = 51 - (QP_MAX_SPEC) + * = 51 - (51 + QP_BD_OFFSET) + * = 0 - (QP_BD_OFFSET) + * = 0 - (6*(BIT_DEPTH-8)) (libx264) + * = 0 - (6*(X265_DEPTH-8)) (libx265) + */ case HB_VCODEC_X264_8BIT: - case HB_VCODEC_X264_10BIT: case HB_VCODEC_X265_8BIT: + *direction = 1; + *granularity = 0.1; + *low = 0.; + *high = 51.; + break; + case HB_VCODEC_X264_10BIT: case HB_VCODEC_X265_10BIT: + *direction = 1; + *granularity = 0.1; + *low = -12.; + *high = 51.; + break; case HB_VCODEC_X265_12BIT: + *direction = 1; + *granularity = 0.1; + *low = -24.; + *high = 51.; + break; case HB_VCODEC_X265_16BIT: *direction = 1; *granularity = 0.1; - *low = 0.; + *low = -48.; *high = 51.; break; |