[cvs] / xvidcore / src / image / postprocessing.c Repository:
ViewVC logotype

Diff of /xvidcore/src/image/postprocessing.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.4.4, Sun Dec 21 19:42:07 2003 UTC revision 1.3, Thu Apr 1 11:11:28 2004 UTC
# Line 33  Line 33 
33  #include "../utils/emms.h"  #include "../utils/emms.h"
34  #include "postprocessing.h"  #include "postprocessing.h"
35    
36    /* function pointers */
37    IMAGEBRIGHTNESS_PTR image_brightness;
38    
39    
40  /* Some useful (and fast) macros  /* Some useful (and fast) macros
41     Note that the MIN/MAX macros assume signed shift - if your compiler     Note that the MIN/MAX macros assume signed shift - if your compiler
42     doesn't do signed shifts, use the default MIN/MAX macros from global.h */     doesn't do signed shifts, use the default MIN/MAX macros from global.h */
# Line 51  Line 55 
55  void  void
56  image_postproc(XVID_POSTPROC *tbls, IMAGE * img, int edged_width,  image_postproc(XVID_POSTPROC *tbls, IMAGE * img, int edged_width,
57                                  const MACROBLOCK * mbs, int mb_width, int mb_height, int mb_stride,                                  const MACROBLOCK * mbs, int mb_width, int mb_height, int mb_stride,
58                                  int flags, int frame_num, int bvop)                                  int flags, int brightness, int frame_num, int bvop)
59  {  {
60          const int edged_width2 = edged_width /2;          const int edged_width2 = edged_width /2;
61          int i,j;          int i,j;
# Line 104  Line 108 
108                  add_noise(tbls, img->y, img->y, edged_width, mb_width*16,                  add_noise(tbls, img->y, img->y, edged_width, mb_width*16,
109                                    mb_height*16, frame_num % 3, tbls->prev_quant);                                    mb_height*16, frame_num % 3, tbls->prev_quant);
110          }          }
111    
112            if (brightness != 0) {
113                    image_brightness(img->y, edged_width, mb_width*16, mb_height*16, brightness);
114            }
115  }  }
116    
117  /******************************************************************************/  /******************************************************************************/
# Line 169  Line 177 
177                                  a31 = ((s[1]<<1) - s[2] * 5 + s[3] * 5 - (s[4]<<1));    \                                  a31 = ((s[1]<<1) - s[2] * 5 + s[3] * 5 - (s[4]<<1));    \
178                                  a32 = ((s[5]<<1) - s[6] * 5 + s[7] * 5 - (s[8]<<1));    \                                  a32 = ((s[5]<<1) - s[6] * 5 + s[7] * 5 - (s[8]<<1));    \
179                                                                                                                                                  \                                                                                                                                                  \
180                                  diff = (5 * ((SIGN(a30) * MIN(tbls->xvid_abs_tbl[a30 + 255], MIN(tbls->xvid_abs_tbl[a31 + 255], tbls->xvid_abs_tbl[a32 + 255]))) - a30) + 32) >> 6;     \                                  diff = (5 * ((SIGN(a30) * MIN(FAST_ABS(a30), MIN(FAST_ABS(a31), FAST_ABS(a32)))) - a30) + 32) >> 6;     \
181                                  limit = (s[4] - s[5]) / 2;      \                                  limit = (s[4] - s[5]) / 2;      \
182                                  \                                  \
183                                  if (limit > 0)                          \                                  if (limit > 0)                          \
# Line 370  Line 378 
378                  src += stride;                  src += stride;
379          }          }
380  }  }
381    
382    
383    void image_brightness_c(uint8_t *dst, int stride, int width, int height, int offset)
384    {
385            int x,y;
386    
387            for(y = 0; y < height; y++)
388            {
389                    for(x = 0; x < width; x++)
390                    {
391                            dst[y*stride + x] = CLIP( dst[y*stride + x] + offset, 0, 255);
392                    }
393            }
394    }

Legend:
Removed from v.1.1.4.4  
changed lines
  Added in v.1.3

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4