On Sat Sep 24 2011 01:45:44 GMT+0200 (CEST), Justin Ruggles wrote:
On 09/23/2011 07:22 PM, Jean First wrote:
- for(i = 0; i< s->height; i++) {
- for(j = soff; j< ssize; j++)
- dst[j] += dst[j - soff];
- dst += stride;
+ if (s->avctx->pix_fmt == PIX_FMT_RGB48LE) {
+ for (i = 0; i< s->height; i++) {
+ for (j = soff; j< ssize; j += 2)
+ AV_WL16(dst + j, AV_RL16(dst + j) + AV_RL16(dst + j -
soff));
+ dst += stride;
+ }
+ } else if (s->avctx->pix_fmt == PIX_FMT_RGB48BE) {
+ for (i = 0; i< s->height; i++) {
+ for (j = soff; j< ssize; j += 2)
+ AV_WB16(dst + j, AV_RB16(dst + j) + AV_RB16(dst + j -
soff));
+ dst += stride;
+ }
+ } else {
+ for (i = 0; i< s->height; i++) {
+ for (j = soff; j< ssize; j++)
+ dst[j] += dst[j - soff];
+ dst += stride;
+ }
i think it would be simpler to output in native-endian pixel format if
predictor == 2.
Ok.
- if(s->invert){
- uint8_t *src;
- int j;
-
- src = s->picture.data[0];
- for(j = 0; j< s->height; j++){
- for(i = 0; i< s->picture.linesize[0]; i++)
- src[i] = 255 - src[i];
- src += s->picture.linesize[0];
+ if (s->invert){
+ dst = s->picture.data[0];
+ for (i = 0; i< s->height; i++) {
+ for (j = 0; j< s->picture.linesize[0]; j++)
+ dst[j] = 255 - dst[j];
+ dst += s->picture.linesize[0];
has this been tested with 16-bit white-is-zero grayscale? the 255 seems
wrong. or is this just clean-up?
This is just cleanup.
The Invert flag is called "Photometric Interpolation" in the spec - and
for RGB Images this has to be set to 2.
But I think for GREY16 this would matter. Also the PAL8 is not covered
by this.
jean
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel