~siretart/libav/merge.raring.libav-0.8.6

« back to all changes in this revision

Viewing changes to libpostproc/postprocess.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:30:00 UTC
  • mfrom: (1.4.1)
  • mto: (1.3.11 sid) (26.1.1 quantal-security)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20120112223000-s1reiy1e28hnix42
Tags: upstream-0.8~beta2
ImportĀ upstreamĀ versionĀ 0.8~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
246
246
static inline int isHorizMinMaxOk_C(uint8_t src[], int stride, int QP)
247
247
{
248
248
    int i;
249
 
#if 1
250
249
    for(i=0; i<2; i++){
251
250
        if((unsigned)(src[0] - src[5] + 2*QP) > 4*QP) return 0;
252
251
        src += stride;
257
256
        if((unsigned)(src[6] - src[3] + 2*QP) > 4*QP) return 0;
258
257
        src += stride;
259
258
    }
260
 
#else
261
 
    for(i=0; i<8; i++){
262
 
        if((unsigned)(src[0] - src[7] + 2*QP) > 4*QP) return 0;
263
 
        src += stride;
264
 
    }
265
 
#endif
266
259
    return 1;
267
260
}
268
261
 
269
262
static inline int isVertMinMaxOk_C(uint8_t src[], int stride, int QP)
270
263
{
271
 
#if 1
272
 
#if 1
273
264
    int x;
274
265
    src+= stride*4;
275
266
    for(x=0; x<BLOCK_SIZE; x+=4){
278
269
        if((unsigned)(src[2+x + 4*stride] - src[2+x + 1*stride] + 2*QP) > 4*QP) return 0;
279
270
        if((unsigned)(src[3+x + 6*stride] - src[3+x + 3*stride] + 2*QP) > 4*QP) return 0;
280
271
    }
281
 
#else
282
 
    int x;
283
 
    src+= stride*3;
284
 
    for(x=0; x<BLOCK_SIZE; x++){
285
 
        if((unsigned)(src[x + stride] - src[x + (stride<<3)] + 2*QP) > 4*QP) return 0;
286
 
    }
287
 
#endif
288
 
    return 1;
289
 
#else
290
 
    int x;
291
 
    src+= stride*4;
292
 
    for(x=0; x<BLOCK_SIZE; x++){
293
 
        int min=255;
294
 
        int max=0;
295
 
        int y;
296
 
        for(y=0; y<8; y++){
297
 
            int v= src[x + y*stride];
298
 
            if(v>max) max=v;
299
 
            if(v<min) min=v;
300
 
        }
301
 
        if(max-min > 2*QP) return 0;
302
 
    }
303
 
    return 1;
304
 
#endif
 
272
    return 1;
305
273
}
306
274
 
307
275
static inline int horizClassify_C(uint8_t src[], int stride, PPContext *c)
676
644
#endif
677
645
            postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
678
646
#endif
679
 
#else //CONFIG_RUNTIME_CPUDETECT
 
647
#else /* CONFIG_RUNTIME_CPUDETECT */
680
648
#if   HAVE_MMX2
681
649
            postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
682
650
#elif HAVE_AMD3DNOW
688
656
#else
689
657
            postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
690
658
#endif
691
 
#endif //!CONFIG_RUNTIME_CPUDETECT
 
659
#endif /* !CONFIG_RUNTIME_CPUDETECT */
692
660
}
693
661
 
694
662
//static void postProcess(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height,
941
909
            c->yHistogram[i]= width*height/64*15/256;
942
910
 
943
911
    for(i=0; i<3; i++){
944
 
        //Note: The +17*1024 is just there so i do not have to worry about r/w over the end.
 
912
        //Note: The +17*1024 is just there so I do not have to worry about r/w over the end.
945
913
        reallocAlign((void **)&c->tempBlurred[i], 8, stride*mbHeight*16 + 17*1024);
946
914
        reallocAlign((void **)&c->tempBlurredPast[i], 8, 256*((height+7)&(~7))/2 + 17*1024);//FIXME size
947
915
    }