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

Function apply_encoder_preset

libhb/encavcodec.c:1646–1696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1644}
1645
1646static int apply_encoder_preset(int vcodec, AVCodecContext *context,
1647 AVDictionary **av_opts,
1648 const char *preset)
1649{
1650 switch (vcodec)
1651 {
1652 case HB_VCODEC_FFMPEG_VP8:
1653 return apply_vp8_preset(av_opts, preset);
1654 case HB_VCODEC_FFMPEG_VP9:
1655 return apply_vp9_preset(av_opts, preset);
1656 case HB_VCODEC_FFMPEG_VP9_10BIT:
1657 return apply_vp9_10bit_preset(av_opts, preset);
1658
1659 case HB_VCODEC_FFMPEG_VCE_H264:
1660 case HB_VCODEC_FFMPEG_VCE_H265:
1661 case HB_VCODEC_FFMPEG_VCE_H265_10BIT:
1662 case HB_VCODEC_FFMPEG_VCE_AV1:
1663 case HB_VCODEC_FFMPEG_VCE_AV1_10BIT:
1664 return apply_vce_preset(av_opts, vcodec, preset);
1665
1666#if HB_PROJECT_FEATURE_NVENC
1667 case HB_VCODEC_FFMPEG_NVENC_H264:
1668 case HB_VCODEC_FFMPEG_NVENC_H265:
1669 case HB_VCODEC_FFMPEG_NVENC_H265_10BIT:
1670 case HB_VCODEC_FFMPEG_NVENC_AV1:
1671 case HB_VCODEC_FFMPEG_NVENC_AV1_10BIT:
1672 preset = hb_map_nvenc_preset_name(preset);
1673 av_dict_set( av_opts, "preset", preset, 0);
1674 break;
1675#endif
1676
1677#if HB_PROJECT_FEATURE_QSV
1678 case HB_VCODEC_FFMPEG_QSV_H264:
1679 case HB_VCODEC_FFMPEG_QSV_H265:
1680 case HB_VCODEC_FFMPEG_QSV_H265_10BIT:
1681 case HB_VCODEC_FFMPEG_QSV_AV1:
1682 case HB_VCODEC_FFMPEG_QSV_AV1_10BIT:
1683 preset = hb_map_qsv_preset_name(preset);
1684 av_dict_set( av_opts, "preset", preset, 0);
1685 hb_log("encavcodec: encoding with preset %s", preset);
1686 break;
1687#endif
1688
1689 case HB_VCODEC_FFMPEG_FFV1:
1690 return apply_ffv1_preset(context, av_opts, preset);
1691 default:
1692 break;
1693 }
1694
1695 return 0;
1696}
1697
1698static int apply_vp9_tune(AVDictionary ** av_opts, const char * tune)
1699{

Callers 1

encavcodecInitFunction · 0.85

Calls 8

apply_vp8_presetFunction · 0.85
apply_vp9_presetFunction · 0.85
apply_vp9_10bit_presetFunction · 0.85
apply_vce_presetFunction · 0.85
hb_map_nvenc_preset_nameFunction · 0.85
hb_map_qsv_preset_nameFunction · 0.85
hb_logFunction · 0.85
apply_ffv1_presetFunction · 0.85

Tested by

no test coverage detected