- /* XXX: not complete test ! */
- pix_fmt_id = ((unsigned)s->h_count[0] << 28) | (s->v_count[0] << 24) |
- (s->h_count[1] << 20) | (s->v_count[1] << 16) |
- (s->h_count[2] << 12) | (s->v_count[2] << 8) |
- (s->h_count[3] << 4) | s->v_count[3];
- av_log(s->avctx, AV_LOG_DEBUG, "pix fmt id %x\n", pix_fmt_id);
- /* NOTE we do not allocate pictures large enough for the possible
- * padding of h/v_count being 4 */
- if (!(pix_fmt_id & 0xD0D0D0D0))
- pix_fmt_id -= (pix_fmt_id & 0xF0F0F0F0) >> 1;
- if (!(pix_fmt_id & 0x0D0D0D0D))
- pix_fmt_id -= (pix_fmt_id & 0x0F0F0F0F) >> 1;
-
- for (i = 0; i < 8; i++) {
- int j = 6 + (i&1) - (i&6);
- int is = (pix_fmt_id >> (4*i)) & 0xF;
- int js = (pix_fmt_id >> (4*j)) & 0xF;
-
- if (is == 1 && js != 2 && (i < 2 || i > 5))
- js = (pix_fmt_id >> ( 8 + 4*(i&1))) & 0xF;
- if (is == 1 && js != 2 && (i < 2 || i > 5))
- js = (pix_fmt_id >> (16 + 4*(i&1))) & 0xF;
-
- if (is == 1 && js == 2) {
- if (i & 1) s->upscale_h[j/2] = 1;
- else s->upscale_v[j/2] = 1;
- }
- }
-
- switch (pix_fmt_id) {
- case 0x11111100:
- if (s->rgb)
- s->avctx->pix_fmt = s->bits <= 9 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_BGR48;
- else {
- if ( s->adobe_transform == 0
- || s->component_id[0] == 'R' - 1 && s->component_id[1] == 'G' - 1 && s->component_id[2] == 'B' - 1) {
- s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_GBRP : AV_PIX_FMT_GBRP16;
- } else {
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
- else s->avctx->pix_fmt = AV_PIX_FMT_YUV444P16;
- s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ /* XXX: not complete test ! */
+ pix_fmt_id = ((unsigned)s->h_count[0] << 28) | (s->v_count[0] << 24) |
+ (s->h_count[1] << 20) | (s->v_count[1] << 16) |
+ (s->h_count[2] << 12) | (s->v_count[2] << 8) |
+ (s->h_count[3] << 4) | s->v_count[3];
+ av_log(s->avctx, AV_LOG_DEBUG, "pix fmt id %x\n", pix_fmt_id);
+ /* NOTE we do not allocate pictures large enough for the possible
+ * padding of h/v_count being 4 */
+ if (!(pix_fmt_id & 0xD0D0D0D0))
+ pix_fmt_id -= (pix_fmt_id & 0xF0F0F0F0) >> 1;
+ if (!(pix_fmt_id & 0x0D0D0D0D))
+ pix_fmt_id -= (pix_fmt_id & 0x0F0F0F0F) >> 1;
+
+ for (i = 0; i < 8; i++) {
+ int j = 6 + (i&1) - (i&6);
+ int is = (pix_fmt_id >> (4*i)) & 0xF;
+ int js = (pix_fmt_id >> (4*j)) & 0xF;
+
+ if (is == 1 && js != 2 && (i < 2 || i > 5))
+ js = (pix_fmt_id >> ( 8 + 4*(i&1))) & 0xF;
+ if (is == 1 && js != 2 && (i < 2 || i > 5))
+ js = (pix_fmt_id >> (16 + 4*(i&1))) & 0xF;
+
+ if (is == 1 && js == 2) {
+ if (i & 1) s->upscale_h[j/2] = 1;
+ else s->upscale_v[j/2] = 1;