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

Function pp_get_context

libpostproc/postprocess.c:963–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

961static const AVClass av_codec_context_class = { "Postproc", context_to_name, NULL };
962
963pp_context *pp_get_context(int width, int height, int cpuCaps){
964 PPContext *c= av_malloc(sizeof(PPContext));
965 int stride= FFALIGN(width, 16); //assumed / will realloc if needed
966 int qpStride= (width+15)/16 + 2; //assumed / will realloc if needed
967
968 memset(c, 0, sizeof(PPContext));
969 c->av_class = &av_codec_context_class;
970 c->cpuCaps= cpuCaps;
971 if(cpuCaps&PP_FORMAT){
972 c->hChromaSubSample= cpuCaps&0x3;
973 c->vChromaSubSample= (cpuCaps>>4)&0x3;
974 }else{
975 c->hChromaSubSample= 1;
976 c->vChromaSubSample= 1;
977 }
978
979 reallocBuffers(c, width, height, stride, qpStride);
980
981 c->frameNum=-1;
982
983 return c;
984}
985
986void pp_free_context(void *vc){
987 PPContext *c = (PPContext*)vc;

Callers

nothing calls this directly

Calls 2

av_mallocFunction · 0.85
reallocBuffersFunction · 0.85

Tested by

no test coverage detected