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 */ |
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; |
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 |
/******************************************************************************/ |
/******************************************************************************/ |
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 |
|
} |