MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / hb_video_quality_get_limits

Function hb_video_quality_get_limits

libhb/common.c:1625–1760  ·  view source on GitHub ↗

Get limits and hints for the UIs. granularity sets the minimum step increments that should be used (it's ok to round up to some nice multiple if you like) direction says whether 'low' limit is highest or lowest quality (direction 0 == lowest value is worst quality)

Source from the content-addressed store, hash-verified

1623// direction says whether 'low' limit is highest or lowest
1624// quality (direction 0 == lowest value is worst quality)
1625void hb_video_quality_get_limits(uint32_t codec, float *low, float *high,
1626 float *granularity, int *direction)
1627{
1628#if HB_PROJECT_FEATURE_QSV
1629 if (codec & HB_VCODEC_QSV_MASK)
1630 {
1631 return hb_qsv_video_quality_get_limits(codec, low, high, granularity,
1632 direction);
1633 }
1634#endif
1635
1636 switch (codec)
1637 {
1638 /*
1639 * H.264/H.265: *low
1640 * = 51 - (QP_MAX_SPEC)
1641 * = 51 - (51 + QP_BD_OFFSET)
1642 * = 0 - (QP_BD_OFFSET)
1643 * = 0 - (6*(BIT_DEPTH-8)) (libx264)
1644 * = 0 - (6*(X265_DEPTH-8)) (libx265)
1645 */
1646 case HB_VCODEC_X264_8BIT:
1647 case HB_VCODEC_X265_8BIT:
1648 case HB_VCODEC_FFMPEG_VCE_H264:
1649 case HB_VCODEC_FFMPEG_VCE_H265:
1650 case HB_VCODEC_FFMPEG_VCE_H265_10BIT:
1651 *direction = 1;
1652 *granularity = 0.1;
1653 *low = 0.;
1654 *high = 51.;
1655 break;
1656 case HB_VCODEC_FFMPEG_NVENC_H264:
1657 case HB_VCODEC_FFMPEG_NVENC_H265:
1658 case HB_VCODEC_FFMPEG_NVENC_H265_10BIT:
1659 *direction = 1;
1660 *granularity = 0.1;
1661 *low = 1.;
1662 *high = 51.;
1663 break;
1664 case HB_VCODEC_FFMPEG_NVENC_AV1:
1665 case HB_VCODEC_FFMPEG_NVENC_AV1_10BIT:
1666 *direction = 1;
1667 *granularity = 0.1;
1668 *low = 1.;
1669 *high = 63.;
1670 break;
1671 case HB_VCODEC_X264_10BIT:
1672 case HB_VCODEC_X265_10BIT:
1673 *direction = 1;
1674 *granularity = 0.1;
1675 *low = -12.;
1676 *high = 51.;
1677 break;
1678 case HB_VCODEC_FFMPEG_VCE_AV1:
1679 case HB_VCODEC_FFMPEG_VCE_AV1_10BIT:
1680 *direction = 1;
1681 *granularity = 1;
1682 *low = 0.;

Callers 3

ghb_vquality_defaultFunction · 0.85
ghb_vquality_rangeFunction · 0.85
vquality_changed_cbFunction · 0.85

Calls 1

Tested by

no test coverage detected