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

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

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

revision 1396, Wed Mar 31 19:35:31 2004 UTC revision 1397, Thu Apr 1 11:11:28 2004 UTC
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: postprocessing.c,v 1.2 2004-03-22 22:36:23 edgomez Exp $   * $Id: postprocessing.c,v 1.3 2004-04-01 11:11:28 suxen_drol Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# 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 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.1396  
changed lines
  Added in v.1397

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