| 961 | static const AVClass av_codec_context_class = { "Postproc", context_to_name, NULL }; |
| 962 | |
| 963 | pp_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 | |
| 986 | void pp_free_context(void *vc){ |
| 987 | PPContext *c = (PPContext*)vc; |
nothing calls this directly
no test coverage detected