- temp = (p[x][2] * 439
- - p[x][0] * 148
- - p[x][1] * 291)/1000 + 128;
-
- temp = (uint8_t)( temp < 0 ? 0 : temp );
- p_vout->p_sys->png_image[1][j] = temp;
-
- temp = ( p[x][0] * 439
- - p[x][1] * 368
- - p[x][2] * 71)/1000 + 128;
- temp = __MAX( __MIN( temp, 255 ), 0 );
-
- p_vout->p_sys->png_image[2][j] = (uint8_t)( temp < 0 ? 0 : temp );
- p_vout->p_sys->png_image_a[1][j] = p_vout->p_sys->png_image_a[0][i];
- j++;
+ uint8_t (*p)[4];
+ int idx;
+ int idxc;
+
+ /* FIXME FIXME */
+ p = (void*)row_pointers[y];
+ idx = x + y * p_vout->p_sys->width;
+ idxc= x/2 + (y/2) * (p_vout->p_sys->width/2);
+
+ if( ((i_parity_width == 0) || (x != (p_vout->p_sys->width - 1))) &&
+ ((i_parity_height == 0) || (y != (p_vout->p_sys->height - 1))))
+ {
+ p_vout->p_sys->png_image_a[0][idx]= p[x][3];
+ p_vout->p_sys->png_image[0][idx]= (p[x][0] * 257
+ + p[x][1] * 504
+ + p[x][2] * 98)/1000 + 16;
+
+ if( ( x % 2 == 0 ) && ( y % 2 == 0 ) )
+ {
+
+ temp = (p[x][2] * 439
+ - p[x][0] * 148
+ - p[x][1] * 291)/1000 + 128;
+
+ temp = __MAX( __MIN( temp, 255 ), 0 );
+ p_vout->p_sys->png_image[1][idxc] = temp;
+
+ temp = ( p[x][0] * 439
+ - p[x][1] * 368
+ - p[x][2] * 71)/1000 + 128;
+ temp = __MAX( __MIN( temp, 255 ), 0 );
+ p_vout->p_sys->png_image[2][idxc] = temp;
+ p_vout->p_sys->png_image_a[1][idxc] = p_vout->p_sys->png_image_a[0][idx];
+
+ }
+
+ } else
+ {
+ p_vout->p_sys->png_image_a[0][idx]= 0;
+ }