Mercurial > libavcodec.hg
comparison dnxhddec.c @ 4688:1cefcd7da878 libavcodec
10l, fix debug, dprintf does not have log level
author | bcoudurier |
---|---|
date | Mon, 19 Mar 2007 16:07:51 +0000 |
parents | 5359a5ab01a8 |
children | 3e15e577ca32 |
comparison
equal
deleted
inserted
replaced
4687:5359a5ab01a8 | 4688:1cefcd7da878 |
---|---|
155 } | 155 } |
156 | 156 |
157 ctx->height = AV_RB16(buf + 0x18); | 157 ctx->height = AV_RB16(buf + 0x18); |
158 ctx->width = AV_RB16(buf + 0x1a); | 158 ctx->width = AV_RB16(buf + 0x1a); |
159 | 159 |
160 dprintf(ctx->avctx, AV_LOG_DEBUG, "width %d, heigth %d\n", ctx->width, ctx->height); | 160 dprintf(ctx->avctx, "width %d, heigth %d\n", ctx->width, ctx->height); |
161 | 161 |
162 if (buf[0x21] & 0x80) { | 162 if (buf[0x21] & 0x80) { |
163 av_log(ctx->avctx, AV_LOG_ERROR, "10 bit per component\n"); | 163 av_log(ctx->avctx, AV_LOG_ERROR, "10 bit per component\n"); |
164 return -1; | 164 return -1; |
165 } | 165 } |
166 | 166 |
167 ctx->cid = AV_RB32(buf + 0x28); | 167 ctx->cid = AV_RB32(buf + 0x28); |
168 dprintf(ctx->avctx, AV_LOG_DEBUG, "compression id %d\n", ctx->cid); | 168 dprintf(ctx->avctx, "compression id %d\n", ctx->cid); |
169 | 169 |
170 if (dnxhd_init_vlc(ctx, ctx->cid) < 0) | 170 if (dnxhd_init_vlc(ctx, ctx->cid) < 0) |
171 return -1; | 171 return -1; |
172 | 172 |
173 if (buf_size < ctx->cid_table->frame_size) { | 173 if (buf_size < ctx->cid_table->frame_size) { |
181 if (ctx->mb_height > 68) { | 181 if (ctx->mb_height > 68) { |
182 av_log(ctx->avctx, AV_LOG_ERROR, "mb height too big\n"); | 182 av_log(ctx->avctx, AV_LOG_ERROR, "mb height too big\n"); |
183 return -1; | 183 return -1; |
184 } | 184 } |
185 | 185 |
186 dprintf(ctx->avctx, AV_LOG_DEBUG, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height); | 186 dprintf(ctx->avctx, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height); |
187 for (i = 0; i < ctx->mb_height; i++) { | 187 for (i = 0; i < ctx->mb_height; i++) { |
188 ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i<<2)); | 188 ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i<<2)); |
189 dprintf(ctx->avctx, AV_LOG_DEBUG, "mb scan index %d\n", ctx->mb_scan_index[i]); | 189 dprintf(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]); |
190 if (buf_size < ctx->mb_scan_index[i] + 0x280) { | 190 if (buf_size < ctx->mb_scan_index[i] + 0x280) { |
191 av_log(ctx->avctx, AV_LOG_ERROR, "invalid mb scan index\n"); | 191 av_log(ctx->avctx, AV_LOG_ERROR, "invalid mb scan index\n"); |
192 return -1; | 192 return -1; |
193 } | 193 } |
194 } | 194 } |
317 uint8_t *buf, int buf_size) | 317 uint8_t *buf, int buf_size) |
318 { | 318 { |
319 DNXHDContext *ctx = avctx->priv_data; | 319 DNXHDContext *ctx = avctx->priv_data; |
320 AVFrame *picture = data; | 320 AVFrame *picture = data; |
321 | 321 |
322 dprintf(avctx, AV_LOG_DEBUG, "frame size %d\n", buf_size); | 322 dprintf(avctx, "frame size %d\n", buf_size); |
323 | 323 |
324 if (dnxhd_decode_header(ctx, buf, buf_size) < 0) | 324 if (dnxhd_decode_header(ctx, buf, buf_size) < 0) |
325 return -1; | 325 return -1; |
326 | 326 |
327 avctx->pix_fmt = PIX_FMT_YUV422P; | 327 avctx->pix_fmt = PIX_FMT_YUV422P; |