• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libav-0.8.8/libavcodec/

Lines Matching refs:avctx

122 static int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)
126 if (avctx->bits_per_coded_sample > 8) {
127 av_log(avctx, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n");
131 count = 1 << avctx->bits_per_coded_sample;
133 count = FFMIN(avctx->extradata_size / 3, count);
136 pal[i] = 0xFF000000 | AV_RB24( avctx->extradata + i*3 );
139 count = 1 << avctx->bits_per_coded_sample;
142 pal[i] = 0xFF000000 | gray2rgb((i * 255) >> avctx->bits_per_coded_sample);
148 static av_cold int decode_init(AVCodecContext *avctx)
150 IffContext *s = avctx->priv_data;
153 if (avctx->bits_per_coded_sample <= 8) {
154 avctx->pix_fmt = (avctx->bits_per_coded_sample < 8 ||
155 avctx->extradata_size) ? PIX_FMT_PAL8
157 } else if (avctx->bits_per_coded_sample <= 32) {
158 avctx->pix_fmt = PIX_FMT_BGR32;
163 if ((err = av_image_check_size(avctx->width, avctx->height, 0, avctx)))
165 s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary
248 static int decode_frame_ilbm(AVCodecContext *avctx,
252 IffContext *s = avctx->priv_data;
259 if ((res = avctx->reget_buffer(avctx, &s->frame)) < 0) {
260 av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
263 } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
264 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
266 } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != PIX_FMT_GRAY8) {
267 if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)
272 if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved
273 if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) {
274 for(y = 0; y < avctx->height; y++ ) {
276 memset(row, 0, avctx->width);
277 for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) {
283 for(y = 0; y < avctx->height; y++ ) {
285 memset(row, 0, avctx->width << 2);
286 for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) {
292 } else if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { // IFF-PBM
293 for(y = 0; y < avctx->height; y++ ) {
295 memcpy(row, buf, FFMIN(avctx->width, buf_end - buf));
296 buf += avctx->width + (avctx->width % 2); // padding if odd
305 static int decode_frame_byterun1(AVCodecContext *avctx,
309 IffContext *s = avctx->priv_data;
316 if ((res = avctx->reget_buffer(avctx, &s->frame)) < 0) {
317 av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
320 } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
321 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
323 } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != PIX_FMT_GRAY8) {
324 if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)
329 if (avctx->codec_tag == MKTAG('I','L','B','M')) { //interleaved
330 if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) {
331 for(y = 0; y < avctx->height ; y++ ) {
333 memset(row, 0, avctx->width);
334 for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) {
340 for(y = 0; y < avctx->height ; y++ ) {
342 memset(row, 0, avctx->width << 2);
343 for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) {
350 for(y = 0; y < avctx->height ; y++ ) {
352 buf += decode_byterun(row, avctx->width, buf, buf_end);
361 static av_cold int decode_end(AVCodecContext *avctx)
363 IffContext *s = avctx->priv_data;
365 avctx->release_buffer(avctx, &s->frame);