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

Function pp_postprocess

libpostproc/postprocess.c:1007–1105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005}
1006
1007void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
1008 uint8_t * dst[3], const int dstStride[3],
1009 int width, int height,
1010 const QP_STORE_T *QP_store, int QPStride,
1011 pp_mode *vm, void *vc, int pict_type)
1012{
1013 int mbWidth = (width+15)>>4;
1014 int mbHeight= (height+15)>>4;
1015 PPMode *mode = (PPMode*)vm;
1016 PPContext *c = (PPContext*)vc;
1017 int minStride= FFMAX(FFABS(srcStride[0]), FFABS(dstStride[0]));
1018 int absQPStride = FFABS(QPStride);
1019
1020 // c->stride and c->QPStride are always positive
1021 if(c->stride < minStride || c->qpStride < absQPStride)
1022 reallocBuffers(c, width, height,
1023 FFMAX(minStride, c->stride),
1024 FFMAX(c->qpStride, absQPStride));
1025
1026 if(QP_store==NULL || (mode->lumMode & FORCE_QUANT)){
1027 int i;
1028 QP_store= c->forcedQPTable;
1029 absQPStride = QPStride = 0;
1030 if(mode->lumMode & FORCE_QUANT)
1031 for(i=0; i<mbWidth; i++) c->forcedQPTable[i]= mode->forcedQuant;
1032 else
1033 for(i=0; i<mbWidth; i++) c->forcedQPTable[i]= 1;
1034 }
1035
1036 if(pict_type & PP_PICT_TYPE_QP2){
1037 int i;
1038 const int count= mbHeight * absQPStride;
1039 for(i=0; i<(count>>2); i++){
1040 ((uint32_t*)c->stdQPTable)[i] = (((const uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F;
1041 }
1042 for(i<<=2; i<count; i++){
1043 c->stdQPTable[i] = QP_store[i]>>1;
1044 }
1045 QP_store= c->stdQPTable;
1046 QPStride= absQPStride;
1047 }
1048
1049 if(0){
1050 int x,y;
1051 for(y=0; y<mbHeight; y++){
1052 for(x=0; x<mbWidth; x++){
1053 av_log(c, AV_LOG_INFO, "%2d ", QP_store[x + y*QPStride]);
1054 }
1055 av_log(c, AV_LOG_INFO, "\n");
1056 }
1057 av_log(c, AV_LOG_INFO, "\n");
1058 }
1059
1060 if((pict_type&7)!=3){
1061 if (QPStride >= 0){
1062 int i;
1063 const int count= mbHeight * QPStride;
1064 for(i=0; i<(count>>2); i++){

Callers

nothing calls this directly

Calls 4

reallocBuffersFunction · 0.85
av_logFunction · 0.85
postProcessFunction · 0.85
linecpyFunction · 0.85

Tested by

no test coverage detected