summaryrefslogtreecommitdiff
path: root/libavcodec/jpeglsdec.c
diff options
context:
space:
mode:
authoranatoly <anatoly.nenashev@ovsoft.ru>2011-03-27 22:16:25 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-12-09 12:24:50 +0100
commit2fade10cb0c53e6b2a663d8ce0566ba7c61013cf (patch)
tree7adbfd6017697ae7220c80c03a29fee26500de35 /libavcodec/jpeglsdec.c
parent9eac7c435f9c9dfc7ed4bbc8ec5a4bc710b486f2 (diff)
downloadffmpeg-2fade10cb0c53e6b2a663d8ce0566ba7c61013cf.tar.gz
Add support for picture_ptr field in MJpegDecodeContext
Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit e0e3b8b297bae5144f23fd4b46a1309857040b63) Conflicts: libavcodec/jpeglsdec.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeglsdec.c')
-rw-r--r--libavcodec/jpeglsdec.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 1dda2073e5..190b9b6d26 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;
}
}
}