| OLD | NEW |
| 1 /** | 1 /** |
| 2 * @file | 2 * @file |
| 3 * Psygnosis YOP decoder | 3 * Psygnosis YOP decoder |
| 4 * | 4 * |
| 5 * Copyright (C) 2010 Mohamed Naufal Basheer <naufal11@gmail.com> | 5 * Copyright (C) 2010 Mohamed Naufal Basheer <naufal11@gmail.com> |
| 6 * derived from the code by | 6 * derived from the code by |
| 7 * Copyright (C) 2009 Thomas P. Higdon <thomas.p.higdon@gmail.com> | 7 * Copyright (C) 2009 Thomas P. Higdon <thomas.p.higdon@gmail.com> |
| 8 * | 8 * |
| 9 * This file is part of FFmpeg. | 9 * This file is part of FFmpeg. |
| 10 * | 10 * |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 { 0, -2}, { 2, -2}, | 78 { 0, -2}, { 2, -2}, |
| 79 { 4, -2}, {-2, 0}, | 79 { 4, -2}, {-2, 0}, |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 static av_cold int yop_decode_init(AVCodecContext *avctx) | 82 static av_cold int yop_decode_init(AVCodecContext *avctx) |
| 83 { | 83 { |
| 84 YopDecContext *s = avctx->priv_data; | 84 YopDecContext *s = avctx->priv_data; |
| 85 s->avctx = avctx; | 85 s->avctx = avctx; |
| 86 | 86 |
| 87 if (avctx->width & 1 || avctx->height & 1 || | 87 if (avctx->width & 1 || avctx->height & 1 || |
| 88 av_check_image_size(avctx->width, avctx->height, 0, avctx) < 0) { | 88 av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) { |
| 89 av_log(avctx, AV_LOG_ERROR, "YOP has invalid dimensions\n"); | 89 av_log(avctx, AV_LOG_ERROR, "YOP has invalid dimensions\n"); |
| 90 return -1; | 90 return -1; |
| 91 } | 91 } |
| 92 | 92 |
| 93 avctx->pix_fmt = PIX_FMT_PAL8; | 93 avctx->pix_fmt = PIX_FMT_PAL8; |
| 94 | 94 |
| 95 s->num_pal_colors = avctx->extradata[0]; | 95 s->num_pal_colors = avctx->extradata[0]; |
| 96 s->first_color[0] = avctx->extradata[1]; | 96 s->first_color[0] = avctx->extradata[1]; |
| 97 s->first_color[1] = avctx->extradata[2]; | 97 s->first_color[1] = avctx->extradata[2]; |
| 98 | 98 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 "yop", | 252 "yop", |
| 253 AVMEDIA_TYPE_VIDEO, | 253 AVMEDIA_TYPE_VIDEO, |
| 254 CODEC_ID_YOP, | 254 CODEC_ID_YOP, |
| 255 sizeof(YopDecContext), | 255 sizeof(YopDecContext), |
| 256 yop_decode_init, | 256 yop_decode_init, |
| 257 NULL, | 257 NULL, |
| 258 yop_decode_close, | 258 yop_decode_close, |
| 259 yop_decode_frame, | 259 yop_decode_frame, |
| 260 .long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"), | 260 .long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"), |
| 261 }; | 261 }; |
| OLD | NEW |