| OLD | NEW |
| 1 /* | 1 /* |
| 2 * SGI image decoder | 2 * SGI image decoder |
| 3 * Todd Kirby <doubleshot@pacbell.net> | 3 * Todd Kirby <doubleshot@pacbell.net> |
| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_GRAY16BE : PIX_FMT_
GRAY8; | 195 avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_GRAY16BE : PIX_FMT_
GRAY8; |
| 196 } else if (s->depth == SGI_RGB) { | 196 } else if (s->depth == SGI_RGB) { |
| 197 avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_RGB48BE : PIX_FMT_R
GB24; | 197 avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_RGB48BE : PIX_FMT_R
GB24; |
| 198 } else if (s->depth == SGI_RGBA && s->bytes_per_channel == 1) { | 198 } else if (s->depth == SGI_RGBA && s->bytes_per_channel == 1) { |
| 199 avctx->pix_fmt = PIX_FMT_RGBA; | 199 avctx->pix_fmt = PIX_FMT_RGBA; |
| 200 } else { | 200 } else { |
| 201 av_log(avctx, AV_LOG_ERROR, "wrong picture format\n"); | 201 av_log(avctx, AV_LOG_ERROR, "wrong picture format\n"); |
| 202 return -1; | 202 return -1; |
| 203 } | 203 } |
| 204 | 204 |
| 205 if (av_check_image_size(s->width, s->height, 0, avctx)) | 205 if (av_image_check_size(s->width, s->height, 0, avctx)) |
| 206 return -1; | 206 return -1; |
| 207 avcodec_set_dimensions(avctx, s->width, s->height); | 207 avcodec_set_dimensions(avctx, s->width, s->height); |
| 208 | 208 |
| 209 if (p->data[0]) | 209 if (p->data[0]) |
| 210 avctx->release_buffer(avctx, p); | 210 avctx->release_buffer(avctx, p); |
| 211 | 211 |
| 212 p->reference = 0; | 212 p->reference = 0; |
| 213 if (avctx->get_buffer(avctx, p) < 0) { | 213 if (avctx->get_buffer(avctx, p) < 0) { |
| 214 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n"); | 214 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n"); |
| 215 return -1; | 215 return -1; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 AVMEDIA_TYPE_VIDEO, | 264 AVMEDIA_TYPE_VIDEO, |
| 265 CODEC_ID_SGI, | 265 CODEC_ID_SGI, |
| 266 sizeof(SgiState), | 266 sizeof(SgiState), |
| 267 sgi_init, | 267 sgi_init, |
| 268 NULL, | 268 NULL, |
| 269 sgi_end, | 269 sgi_end, |
| 270 decode_frame, | 270 decode_frame, |
| 271 .long_name = NULL_IF_CONFIG_SMALL("SGI image"), | 271 .long_name = NULL_IF_CONFIG_SMALL("SGI image"), |
| 272 }; | 272 }; |
| 273 | 273 |
| OLD | NEW |