Commit d3b4b74c authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

Fix lossless jpeg encoder to comply to spec and store full redundant

residuals, Note this does not change RGB32 as we need to check this
against some decoder that supports it.

Originally committed as revision 15055 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent c979fa03
......@@ -141,9 +141,9 @@ static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, in
}
if(i==0)
ff_mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
ff_mjpeg_encode_dc(s, *ptr - pred, m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
else
ff_mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
ff_mjpeg_encode_dc(s, *ptr - pred, m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
}
}
}
......@@ -164,9 +164,9 @@ static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, in
PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
if(i==0)
ff_mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
ff_mjpeg_encode_dc(s, *ptr - pred, m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
else
ff_mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
ff_mjpeg_encode_dc(s, *ptr - pred, m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
}
}
}
......
......@@ -110,8 +110,8 @@ stddev: 6.34 PSNR: 32.07 bytes: 7603200/ 7603200
1567580 ./tests/data/a-mjpeg.avi
18c3a76f984e717dd886d21fa04355f6 *./tests/data/mjpeg.vsynth.out.yuv
stddev: 7.93 PSNR: 30.13 bytes: 7603200/ 7603200
5a662e3833d900b56cca79ba5ed5ec06 *./tests/data/a-ljpeg.avi
6264498 ./tests/data/a-ljpeg.avi
7c79e97bbe4b2eac12a4bef0568eeb93 *./tests/data/a-ljpeg.avi
6312866 ./tests/data/a-ljpeg.avi
799d3db687f6cdd7a837ec156efc171f *./tests/data/ljpeg.vsynth.out.yuv
stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
dca9d700da7857217408c310c501b9bc *./tests/data/a-jpegls.avi
......
......@@ -110,8 +110,8 @@ b179402bba391073b5f5f9324a834061 *./tests/data/a-mjpeg.avi
703564 ./tests/data/a-mjpeg.avi
b1aa72cfb6f9cc3f525b27abc86a8f51 *./tests/data/mjpeg.rotozoom.out.yuv
stddev: 4.38 PSNR: 35.28 bytes: 7603200/ 7603200
bc0d8c868c1a05db0ff03f41768f6c5e *./tests/data/a-ljpeg.avi
4766558 ./tests/data/a-ljpeg.avi
554a4a6a5a9058c588f8bf2de405bc70 *./tests/data/a-ljpeg.avi
4766914 ./tests/data/a-ljpeg.avi
dde5895817ad9d219f79a52d0bdfb001 *./tests/data/ljpeg.rotozoom.out.yuv
stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
f67cd488dfd06c03ad1d6d94d81b80c8 *./tests/data/a-jpegls.avi
......
......@@ -997,51 +997,51 @@ ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:2036046 size:159683 flags:1
ret:-1 st:-1 ts:-0.645825 flags:1
----------------
tests/data/a-ljpeg.avi
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101714 size:96046 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101738 size:96069 flags:1
ret: 0 st:-1 ts:-1.000000 flags:0
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101714 size:96046 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101738 size:96069 flags:1
ret: 0 st:-1 ts:1.894167 flags:1
ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:4576420 size:94867 flags:1
ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:4576754 size:94870 flags:1
ret: 0 st: 0 ts:0.800000 flags:0
ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:1997656 size:95452 flags:1
ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:1997804 size:95465 flags:1
ret:-1 st: 0 ts:-0.320000 flags:1
ret:-1 st:-1 ts:2.576668 flags:0
ret: 0 st:-1 ts:1.470835 flags:1
ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:3623216 size:95720 flags:1
ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:3623468 size:95724 flags:1
ret: 0 st: 0 ts:0.360000 flags:0
ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:949522 size:94624 flags:1
ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:949600 size:94635 flags:1
ret:-1 st: 0 ts:-0.760000 flags:1
ret:-1 st:-1 ts:2.153336 flags:0
ret: 0 st:-1 ts:1.047503 flags:1
ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:2571070 size:95642 flags:1
ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:2571236 size:95649 flags:1
ret: 0 st: 0 ts:-0.040000 flags:0
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101714 size:96046 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101738 size:96069 flags:1
ret: 0 st: 0 ts:2.840000 flags:1
ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:94581 flags:1
ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:94595 flags:1
ret: 0 st:-1 ts:1.730004 flags:0
ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:4196396 size:95340 flags:1
ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:4196712 size:95353 flags:1
ret: 0 st:-1 ts:0.624171 flags:1
ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:1615596 size:95411 flags:1
ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:1615714 size:95410 flags:1
ret: 0 st: 0 ts:-0.480000 flags:0
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101714 size:96046 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101738 size:96069 flags:1
ret: 0 st: 0 ts:2.400000 flags:1
ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:94581 flags:1
ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:94595 flags:1
ret: 0 st:-1 ts:1.306672 flags:0
ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:3240494 size:95577 flags:1
ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:3240722 size:95587 flags:1
ret: 0 st:-1 ts:0.200839 flags:1
ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:571462 size:94255 flags:1
ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:571508 size:94261 flags:1
ret: 0 st: 0 ts:-0.920000 flags:0
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101714 size:96046 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:101738 size:96069 flags:1
ret: 0 st: 0 ts:2.000000 flags:1
ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:94581 flags:1
ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:94595 flags:1
ret: 0 st:-1 ts:0.883340 flags:0
ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:2188690 size:95527 flags:1
ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:2188850 size:95528 flags:1
ret:-1 st:-1 ts:-0.222493 flags:1
ret:-1 st: 0 ts:2.680000 flags:0
ret: 0 st: 0 ts:1.560000 flags:1
ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:3814484 size:95608 flags:1
ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:3814762 size:95615 flags:1
ret: 0 st:-1 ts:0.460008 flags:0
ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:1234190 size:95024 flags:1
ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:1234290 size:95032 flags:1
ret:-1 st:-1 ts:-0.645825 flags:1
----------------
tests/data/a-mjpeg.avi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment