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

Function ff_encode_add_cpb_side_data

libavcodec/encode.c:888–917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886}
887
888AVCPBProperties *ff_encode_add_cpb_side_data(AVCodecContext *avctx)
889{
890 AVPacketSideData *tmp;
891 AVCPBProperties *props;
892 size_t size;
893 int i;
894
895 for (i = 0; i < avctx->nb_coded_side_data; i++)
896 if (avctx->coded_side_data[i].type == AV_PKT_DATA_CPB_PROPERTIES)
897 return (AVCPBProperties *)avctx->coded_side_data[i].data;
898
899 props = av_cpb_properties_alloc(&size);
900 if (!props)
901 return NULL;
902
903 tmp = av_realloc_array(avctx->coded_side_data, avctx->nb_coded_side_data + 1, sizeof(*tmp));
904 if (!tmp) {
905 av_freep(&props);
906 return NULL;
907 }
908
909 avctx->coded_side_data = tmp;
910 avctx->nb_coded_side_data++;
911
912 avctx->coded_side_data[avctx->nb_coded_side_data - 1].type = AV_PKT_DATA_CPB_PROPERTIES;
913 avctx->coded_side_data[avctx->nb_coded_side_data - 1].data = (uint8_t*)props;
914 avctx->coded_side_data[avctx->nb_coded_side_data - 1].size = size;
915
916 return props;
917}
918
919int ff_encode_add_stats_side_data(AVPacket *pkt, int quality, const int64_t error[],
920 int error_count, enum AVPictureType pict_type)

Callers 10

qsv_retrieve_enc_paramsFunction · 0.85
svc_encode_initFunction · 0.85
libx265_encode_initFunction · 0.85
X264_initFunction · 0.85
nvenc_setup_encoderFunction · 0.85
vpx_initFunction · 0.85
aom_initFunction · 0.85
aac_encode_initFunction · 0.85
ff_mpv_encode_initFunction · 0.85
config_enc_paramsFunction · 0.85

Calls 3

av_cpb_properties_allocFunction · 0.85
av_realloc_arrayFunction · 0.85
av_freepFunction · 0.85

Tested by

no test coverage detected