@@ -603,6 +603,19 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
}
break;
+ case 0x11412100:
+ if (s->bits > 8)
+ goto unk_pixfmt;
+ if (s->component_id[0] == 'R' - 1 && s->component_id[1] == 'G' - 1 && s->component_id[2] == 'B' - 1) {
+ s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
+ s->upscale_h[0] = 0;
+ s->upscale_h[1] = 1;
+ s->upscale_h[2] = 4;
+ } else {
+ goto unk_pixfmt;
+ }
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ break;
case 0x21111100:
if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') {
if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
@@ -2696,6 +2709,12 @@ the_end:
for (index = w - 3; index > 0; index--) {
line[index] = (line[index / 3] + line[(index + 1) / 3] + line[(index + 2) / 3] + 1) / 3;
}
+ } else if (s->upscale_h[p] == 4 && w >= 4 && !is16bit){
+ line [w - 1] = line [w - 1 >> 2];
+ line [w - 2] = line [w - 1 >> 2] * 3 + line [w - 2 >> 2] >> 2;
+ line [w - 3] = line [w - 1 >> 2] + line [w - 2 >> 2] >> 1;
+ for (index = w - 4; index > 0; index--)
+ line[index] = (line[index + 3 >> 2] + line[index + 2 >> 2] + line[index + 1 >> 2] + line[index >> 2]) >> 2;
}
line += s->linesize[p];
}