MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / vaapi_encode_h265_init

Function vaapi_encode_h265_init

libavcodec/vaapi_encode_h265.c:1061–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1059};
1060
1061static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
1062{
1063 VAAPIEncodeContext *ctx = avctx->priv_data;
1064 VAAPIEncodeH265Context *priv = avctx->priv_data;
1065
1066 ctx->codec = &vaapi_encode_type_h265;
1067
1068 if (avctx->profile == AV_PROFILE_UNKNOWN)
1069 avctx->profile = priv->profile;
1070 if (avctx->level == AV_LEVEL_UNKNOWN)
1071 avctx->level = priv->level;
1072
1073 if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) {
1074 av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit "
1075 "in 8-bit unsigned integer.\n", avctx->level);
1076 return AVERROR(EINVAL);
1077 }
1078
1079 ctx->desired_packed_headers =
1080 VA_ENC_PACKED_HEADER_SEQUENCE | // VPS, SPS and PPS.
1081 VA_ENC_PACKED_HEADER_SLICE | // Slice headers.
1082 VA_ENC_PACKED_HEADER_MISC; // SEI
1083
1084 if (priv->qp > 0)
1085 ctx->explicit_qp = priv->qp;
1086
1087 return ff_vaapi_encode_init(avctx);
1088}
1089
1090static av_cold int vaapi_encode_h265_close(AVCodecContext *avctx)
1091{

Callers

nothing calls this directly

Calls 2

av_logFunction · 0.85
ff_vaapi_encode_initFunction · 0.85

Tested by

no test coverage detected