Re: [FFmpeg-devel] [PATCH 1/2] swscale: fix dithers table for DITHER_COPY macro

2018-02-02 Thread Mateusz
W dniu 24.10.2017 o 10:02, Mateusz pisze:
> The Bayer matrix 8x8 used in DITHER_COPY macro is table dithers[5].
> Remaining dithers[] matrixes are generated from this matrix by
> downshift or upshift.
> 
> This patch fixes dithers[6] and dithers[7] matrixes -- they were
> too dark.
> 
> Signed-off-by: Mateusz Brzostek 
> ---
>  libswscale/swscale_unscaled.c | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)

ping 2

I've attached simple C program that generates all dithers[] tables
from dithers[5] table. There are 512 numbers to check, so it is simpler
to generate all tables, copy result to source file and use 'git diff'
to check them all.

It's time to finally fix DITHER_COPY macro and maybe optionally copy 
the changes to release 3.4.2.

Mateusz
#include 
#include 

const uint8_t dithers5[8][8] = {
  {  18, 34, 30, 46, 17, 33, 29, 45,},
  {  50,  2, 62, 14, 49,  1, 61, 13,},
  {  26, 42, 22, 38, 25, 41, 21, 37,},
  {  58, 10, 54,  6, 57,  9, 53,  5,},
  {  16, 32, 28, 44, 19, 35, 31, 47,},
  {  48,  0, 60, 12, 51,  3, 63, 15,},
  {  24, 40, 20, 36, 27, 43, 23, 39,},
  {  56,  8, 52,  4, 59, 11, 55,  7,},
};

int main() {
for (int b = 0; b < 8; b++) {
for (int y = 0; y < 8; y++) {
printf("  { ");
for (int x = 0; x < 8; x++)
printf("%3d,", b <= 5 ? dithers5[y][x] >> (5-b) : 
dithers5[y][x] << (b-5));
printf("},\n");
}
printf("},{\n");
}
return 0;
}
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] swscale: fix dithers table for DITHER_COPY macro

2017-11-11 Thread Mateusz
W dniu 24.10.2017 o 10:02, Mateusz pisze:
> The Bayer matrix 8x8 used in DITHER_COPY macro is table dithers[5].
> Remaining dithers[] matrixes are generated from this matrix by
> downshift or upshift.
> 
> This patch fixes dithers[6] and dithers[7] matrixes -- they were
> too dark.

ping

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel