[FFmpeg-cvslog] Add support for picture_ptr field in MJpegDecodeContext
anatoly
git at videolan.org
Tue Jan 7 21:35:27 CET 2014
ffmpeg | branch: release/2.1 | anatoly <anatoly.nenashev at ovsoft.ru> | Sun Mar 27 22:16:25 2011 +0200| [f448478a311f2650e0bc48c79c67f2114d898919] | committer: Michael Niedermayer
Add support for picture_ptr field in MJpegDecodeContext
Signed-off-by: Anton Khirnov <anton at khirnov.net>
(cherry picked from commit e0e3b8b297bae5144f23fd4b46a1309857040b63)
Conflicts:
libavcodec/jpeglsdec.c
libavcodec/mjpegbdec.c
libavcodec/mjpegdec.c
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 2fade10cb0c53e6b2a663d8ce0566ba7c61013cf)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f448478a311f2650e0bc48c79c67f2114d898919
---
libavcodec/jpeglsdec.c | 22 +++++++++++-----------
libavcodec/mjpegdec.c | 12 ++++++------
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 1dda207..190b9b6 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -281,9 +281,9 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
JLSState *state;
int off = 0, stride = 1, width, shift, ret = 0;
- zero = av_mallocz(s->picture.linesize[0]);
+ zero = av_mallocz(s->picture_ptr->linesize[0]);
last = zero;
- cur = s->picture.data[0];
+ cur = s->picture_ptr->data[0];
state = av_mallocz(sizeof(JLSState));
/* initialize JPEG-LS state from JPEG parameters */
@@ -330,7 +330,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
t = *((uint16_t *)last);
}
last = cur;
- cur += s->picture.linesize[0];
+ cur += s->picture_ptr->linesize[0];
if (s->restart_interval && !--s->restart_count) {
align_get_bits(&s->gb);
@@ -341,7 +341,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
int j;
int Rc[3] = { 0, 0, 0 };
stride = (s->nb_components > 1) ? 3 : 1;
- memset(cur, 0, s->picture.linesize[0]);
+ memset(cur, 0, s->picture_ptr->linesize[0]);
width = s->width * stride;
for (i = 0; i < s->height; i++) {
for (j = 0; j < stride; j++) {
@@ -355,7 +355,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
}
}
last = cur;
- cur += s->picture.linesize[0];
+ cur += s->picture_ptr->linesize[0];
}
} else if (ilv == 2) { /* sample interleaving */
avpriv_report_missing_feature(s->avctx, "Sample interleaved images");
@@ -369,7 +369,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
w = s->width * s->nb_components;
if (s->bits <= 8) {
- uint8_t *src = s->picture.data[0];
+ uint8_t *src = s->picture_ptr->data[0];
for (i = 0; i < s->height; i++) {
switch(s->xfrm) {
@@ -404,7 +404,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
}
break;
}
- src += s->picture.linesize[0];
+ src += s->picture_ptr->linesize[0];
}
}else
avpriv_report_missing_feature(s->avctx, "16bit xfrm");
@@ -416,20 +416,20 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
w = s->width * s->nb_components;
if (s->bits <= 8) {
- uint8_t *src = s->picture.data[0];
+ uint8_t *src = s->picture_ptr->data[0];
for (i = 0; i < s->height; i++) {
for (x = off; x < w; x += stride)
src[x] <<= shift;
- src += s->picture.linesize[0];
+ src += s->picture_ptr->linesize[0];
}
} else {
- uint16_t *src = (uint16_t *)s->picture.data[0];
+ uint16_t *src = (uint16_t *)s->picture_ptr->data[0];
for (i = 0; i < s->height; i++) {
for (x = 0; x < w; x++)
src[x] <<= shift;
- src += s->picture.linesize[0] / 2;
+ src += s->picture_ptr->linesize[0] / 2;
}
}
}
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 986e038..f4e082f 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -826,7 +826,7 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p
buffer[0][i] = 1 << (s->bits - 1);
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
- uint8_t *ptr = s->picture.data[0] + (linesize * mb_y);
+ uint8_t *ptr = s->picture_ptr->data[0] + (linesize * mb_y);
if (s->interlaced && s->bottom_field)
ptr += linesize >> 1;
@@ -960,7 +960,7 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
if(dc == 0xFFFFF)
return -1;
if(bits<=8){
- ptr = s->picture.data[c] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
+ ptr = s->picture_ptr->data[c] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
if(y==0 && toprow){
if(x==0 && leftcol){
pred= 1 << (bits - 1);
@@ -980,7 +980,7 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
pred &= mask;
*ptr= pred + (dc << point_transform);
}else{
- ptr16 = (uint16_t*)(s->picture.data[c] + 2*(linesize * (v * mb_y + y)) + 2*(h * mb_x + x)); //FIXME optimize this crap
+ ptr16 = (uint16_t*)(s->picture_ptr->data[c] + 2*(linesize * (v * mb_y + y)) + 2*(h * mb_x + x)); //FIXME optimize this crap
if(y==0 && toprow){
if(x==0 && leftcol){
pred= 1 << (bits - 1);
@@ -1028,7 +1028,7 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
if(dc == 0xFFFFF)
return -1;
if(bits<=8){
- ptr = s->picture.data[c] +
+ ptr = s->picture_ptr->data[c] +
(linesize * (v * mb_y + y)) +
(h * mb_x + x); //FIXME optimize this crap
PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
@@ -1036,7 +1036,7 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
pred &= mask;
*ptr = pred + (dc << point_transform);
}else{
- ptr16 = (uint16_t*)(s->picture.data[c] + 2*(linesize * (v * mb_y + y)) + 2*(h * mb_x + x)); //FIXME optimize this crap
+ ptr16 = (uint16_t*)(s->picture_ptr->data[c] + 2*(linesize * (v * mb_y + y)) + 2*(h * mb_x + x)); //FIXME optimize this crap
PREDICT(pred, ptr16[-linesize-1], ptr16[-linesize], ptr16[-1], predictor);
pred &= mask;
@@ -1210,7 +1210,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
int mb_x, mb_y;
int EOBRUN = 0;
int c = s->comp_index[0];
- uint8_t *data = s->picture.data[c];
+ uint8_t *data = s->picture_ptr->data[c];
int linesize = s->linesize[c];
int last_scan = 0;
int16_t *quant_matrix = s->quant_matrixes[s->quant_sindex[0]];
More information about the ffmpeg-cvslog
mailing list