| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Electronic Arts CMV Video Decoder | 2 * Electronic Arts CMV Video Decoder |
| 3 * Copyright (c) 2007-2008 Peter Ross | 3 * Copyright (c) 2007-2008 Peter Ross |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 const uint8_t *buf = avpkt->data; | 150 const uint8_t *buf = avpkt->data; |
| 151 int buf_size = avpkt->size; | 151 int buf_size = avpkt->size; |
| 152 CmvContext *s = avctx->priv_data; | 152 CmvContext *s = avctx->priv_data; |
| 153 const uint8_t *buf_end = buf + buf_size; | 153 const uint8_t *buf_end = buf + buf_size; |
| 154 | 154 |
| 155 if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) { | 155 if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) { |
| 156 cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end); | 156 cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end); |
| 157 return buf_size; | 157 return buf_size; |
| 158 } | 158 } |
| 159 | 159 |
| 160 if (av_check_image_size(s->width, s->height, 0, s->avctx)) | 160 if (av_image_check_size(s->width, s->height, 0, s->avctx)) |
| 161 return -1; | 161 return -1; |
| 162 | 162 |
| 163 /* shuffle */ | 163 /* shuffle */ |
| 164 if (s->last2_frame.data[0]) | 164 if (s->last2_frame.data[0]) |
| 165 avctx->release_buffer(avctx, &s->last2_frame); | 165 avctx->release_buffer(avctx, &s->last2_frame); |
| 166 FFSWAP(AVFrame, s->last_frame, s->last2_frame); | 166 FFSWAP(AVFrame, s->last_frame, s->last2_frame); |
| 167 FFSWAP(AVFrame, s->frame, s->last_frame); | 167 FFSWAP(AVFrame, s->frame, s->last_frame); |
| 168 | 168 |
| 169 s->frame.reference = 1; | 169 s->frame.reference = 1; |
| 170 s->frame.buffer_hints = FF_BUFFER_HINTS_VALID; | 170 s->frame.buffer_hints = FF_BUFFER_HINTS_VALID; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 AVMEDIA_TYPE_VIDEO, | 209 AVMEDIA_TYPE_VIDEO, |
| 210 CODEC_ID_CMV, | 210 CODEC_ID_CMV, |
| 211 sizeof(CmvContext), | 211 sizeof(CmvContext), |
| 212 cmv_decode_init, | 212 cmv_decode_init, |
| 213 NULL, | 213 NULL, |
| 214 cmv_decode_end, | 214 cmv_decode_end, |
| 215 cmv_decode_frame, | 215 cmv_decode_frame, |
| 216 CODEC_CAP_DR1, | 216 CODEC_CAP_DR1, |
| 217 .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"), | 217 .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"), |
| 218 }; | 218 }; |
| OLD | NEW |