comparison rawdec.c @ 7823:4525dcd81357 libavcodec

Bump Major version, this commit is almost just renaming bits_per_sample to bits_per_coded_sample but that cannot be done seperately. Patch by Luca Abeni Also reset the minor version and fix the forgotton change to libfaad. Note: The API/ABI should not be considered stable yet, there still may be a change done here or there if some developer has some cleanup ideas and patches!
author michael
date Mon, 08 Sep 2008 14:24:59 +0000
parents e943e1409077
children 76f6a08c9fe6
comparison
equal deleted inserted replaced
7822:67cfe4983e6d 7823:4525dcd81357
67 static av_cold int raw_init_decoder(AVCodecContext *avctx) 67 static av_cold int raw_init_decoder(AVCodecContext *avctx)
68 { 68 {
69 RawVideoContext *context = avctx->priv_data; 69 RawVideoContext *context = avctx->priv_data;
70 70
71 if (avctx->codec_tag == MKTAG('r','a','w',' ')) 71 if (avctx->codec_tag == MKTAG('r','a','w',' '))
72 avctx->pix_fmt = findPixelFormat(pixelFormatBpsMOV, avctx->bits_per_sample); 72 avctx->pix_fmt = findPixelFormat(pixelFormatBpsMOV, avctx->bits_per_coded_sample);
73 else if (avctx->codec_tag) 73 else if (avctx->codec_tag)
74 avctx->pix_fmt = findPixelFormat(ff_raw_pixelFormatTags, avctx->codec_tag); 74 avctx->pix_fmt = findPixelFormat(ff_raw_pixelFormatTags, avctx->codec_tag);
75 else if (avctx->bits_per_sample) 75 else if (avctx->bits_per_coded_sample)
76 avctx->pix_fmt = findPixelFormat(pixelFormatBpsAVI, avctx->bits_per_sample); 76 avctx->pix_fmt = findPixelFormat(pixelFormatBpsAVI, avctx->bits_per_coded_sample);
77 77
78 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); 78 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
79 context->buffer = av_malloc(context->length); 79 context->buffer = av_malloc(context->length);
80 context->pic.pict_type = FF_I_TYPE; 80 context->pic.pict_type = FF_I_TYPE;
81 context->pic.key_frame = 1; 81 context->pic.key_frame = 1;
87 87
88 return 0; 88 return 0;
89 } 89 }
90 90
91 static void flip(AVCodecContext *avctx, AVPicture * picture){ 91 static void flip(AVCodecContext *avctx, AVPicture * picture){
92 if(!avctx->codec_tag && avctx->bits_per_sample && picture->linesize[2]==0){ 92 if(!avctx->codec_tag && avctx->bits_per_coded_sample && picture->linesize[2]==0){
93 picture->data[0] += picture->linesize[0] * (avctx->height-1); 93 picture->data[0] += picture->linesize[0] * (avctx->height-1);
94 picture->linesize[0] *= -1; 94 picture->linesize[0] *= -1;
95 } 95 }
96 } 96 }
97 97
106 106
107 frame->interlaced_frame = avctx->coded_frame->interlaced_frame; 107 frame->interlaced_frame = avctx->coded_frame->interlaced_frame;
108 frame->top_field_first = avctx->coded_frame->top_field_first; 108 frame->top_field_first = avctx->coded_frame->top_field_first;
109 109
110 //4bpp raw in avi and mov (yes this is ugly ...) 110 //4bpp raw in avi and mov (yes this is ugly ...)
111 if(avctx->bits_per_sample == 4 && avctx->pix_fmt==PIX_FMT_PAL8 && 111 if(avctx->bits_per_coded_sample == 4 && avctx->pix_fmt==PIX_FMT_PAL8 &&
112 (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){ 112 (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){
113 int i; 113 int i;
114 for(i=256*2; i+1 < context->length>>1; i++){ 114 for(i=256*2; i+1 < context->length>>1; i++){
115 context->buffer[2*i+0]= buf[i-256*2]>>4; 115 context->buffer[2*i+0]= buf[i-256*2]>>4;
116 context->buffer[2*i+1]= buf[i-256*2]&15; 116 context->buffer[2*i+1]= buf[i-256*2]&15;