| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Westwood Studios VQA Video Decoder | 2 * Westwood Studios VQA Video Decoder |
| 3 * Copyright (C) 2003 the ffmpeg project | 3 * Copyright (C) 2003 the ffmpeg project |
| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 if (s->avctx->extradata_size != VQA_HEADER_SIZE) { | 141 if (s->avctx->extradata_size != VQA_HEADER_SIZE) { |
| 142 av_log(s->avctx, AV_LOG_ERROR, " VQA video: expected extradata size of
%d\n", VQA_HEADER_SIZE); | 142 av_log(s->avctx, AV_LOG_ERROR, " VQA video: expected extradata size of
%d\n", VQA_HEADER_SIZE); |
| 143 return -1; | 143 return -1; |
| 144 } | 144 } |
| 145 | 145 |
| 146 /* load up the VQA parameters from the header */ | 146 /* load up the VQA parameters from the header */ |
| 147 vqa_header = (unsigned char *)s->avctx->extradata; | 147 vqa_header = (unsigned char *)s->avctx->extradata; |
| 148 s->vqa_version = vqa_header[0]; | 148 s->vqa_version = vqa_header[0]; |
| 149 s->width = AV_RL16(&vqa_header[6]); | 149 s->width = AV_RL16(&vqa_header[6]); |
| 150 s->height = AV_RL16(&vqa_header[8]); | 150 s->height = AV_RL16(&vqa_header[8]); |
| 151 if(av_check_image_size(s->width, s->height, 0, avctx)){ | 151 if(av_image_check_size(s->width, s->height, 0, avctx)){ |
| 152 s->width= s->height= 0; | 152 s->width= s->height= 0; |
| 153 return -1; | 153 return -1; |
| 154 } | 154 } |
| 155 s->vector_width = vqa_header[10]; | 155 s->vector_width = vqa_header[10]; |
| 156 s->vector_height = vqa_header[11]; | 156 s->vector_height = vqa_header[11]; |
| 157 s->partial_count = s->partial_countdown = vqa_header[13]; | 157 s->partial_count = s->partial_countdown = vqa_header[13]; |
| 158 | 158 |
| 159 /* the vector dimensions have to meet very stringent requirements */ | 159 /* the vector dimensions have to meet very stringent requirements */ |
| 160 if ((s->vector_width != 4) || | 160 if ((s->vector_width != 4) || |
| 161 ((s->vector_height != 2) && (s->vector_height != 4))) { | 161 ((s->vector_height != 2) && (s->vector_height != 4))) { |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 AVMEDIA_TYPE_VIDEO, | 614 AVMEDIA_TYPE_VIDEO, |
| 615 CODEC_ID_WS_VQA, | 615 CODEC_ID_WS_VQA, |
| 616 sizeof(VqaContext), | 616 sizeof(VqaContext), |
| 617 vqa_decode_init, | 617 vqa_decode_init, |
| 618 NULL, | 618 NULL, |
| 619 vqa_decode_end, | 619 vqa_decode_end, |
| 620 vqa_decode_frame, | 620 vqa_decode_frame, |
| 621 CODEC_CAP_DR1, | 621 CODEC_CAP_DR1, |
| 622 .long_name = NULL_IF_CONFIG_SMALL("Westwood Studios VQA (Vector Quantized An
imation) video"), | 622 .long_name = NULL_IF_CONFIG_SMALL("Westwood Studios VQA (Vector Quantized An
imation) video"), |
| 623 }; | 623 }; |
| OLD | NEW |