Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
27th March 2008, 06:32 | #1 | Link |
A hollow voice says
Join Date: Sep 2006
Posts: 269
|
xvid's chroma optimizer
Is there a way to impliment this in a script so I can 'see' what it does?
Code:
image_chroma_optimize(IMAGE * img, int width, int height, int edged_width) { int x,y; for (y = 1; y < height/2 - 1; y++) for (x = 1; x < width/2 - 1; x++) { #define IS_PURE(a) ((a)<=16||(a)>=235) #define IMG_Y(Y,X) img->y[(Y)*edged_width + (X)] #define IMG_U(Y,X) img->u[(Y)*edged_width/2 + (X)] #define IMG_V(Y,X) img->v[(Y)*edged_width/2 + (X)] if (IS_PURE(IMG_Y(y*2 ,x*2 )) && IS_PURE(IMG_Y(y*2 ,x*2+1)) && IS_PURE(IMG_Y(y*2+1,x*2 )) && IS_PURE(IMG_Y(y*2+1,x*2+1))) { IMG_U(y,x) = (IMG_U(y,x-1) + IMG_U(y-1, x) + IMG_U(y, x+1) + IMG_U(y+1, x)) / 4; IMG_V(y,x) = (IMG_V(y,x-1) + IMG_V(y-1, x) + IMG_V(y, x+1) + IMG_V(y+1, x)) / 4; } } It doesn't have to be efficient, as I don't intend to actually run a full movie through such a script. I just want to compare before and after on some frames... |
|
|