Mercurial > libavcodec.hg
comparison asv1.c @ 10406:825c7f57cfac libavcodec
Remove silly casts to the same type as we already have.
author | reimar |
---|---|
date | Thu, 15 Oct 2009 17:19:07 +0000 |
parents | c687042d9bde |
children | bdf4a9ca162a |
comparison
equal
deleted
inserted
replaced
10405:c687042d9bde | 10406:825c7f57cfac |
---|---|
392 { | 392 { |
393 const uint8_t *buf = avpkt->data; | 393 const uint8_t *buf = avpkt->data; |
394 int buf_size = avpkt->size; | 394 int buf_size = avpkt->size; |
395 ASV1Context * const a = avctx->priv_data; | 395 ASV1Context * const a = avctx->priv_data; |
396 AVFrame *picture = data; | 396 AVFrame *picture = data; |
397 AVFrame * const p= (AVFrame*)&a->picture; | 397 AVFrame * const p= &a->picture; |
398 int mb_x, mb_y; | 398 int mb_x, mb_y; |
399 | 399 |
400 if(p->data[0]) | 400 if(p->data[0]) |
401 avctx->release_buffer(avctx, p); | 401 avctx->release_buffer(avctx, p); |
402 | 402 |
472 | 472 |
473 #if CONFIG_ASV1_ENCODER || CONFIG_ASV2_ENCODER | 473 #if CONFIG_ASV1_ENCODER || CONFIG_ASV2_ENCODER |
474 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ | 474 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ |
475 ASV1Context * const a = avctx->priv_data; | 475 ASV1Context * const a = avctx->priv_data; |
476 AVFrame *pict = data; | 476 AVFrame *pict = data; |
477 AVFrame * const p= (AVFrame*)&a->picture; | 477 AVFrame * const p= &a->picture; |
478 int size; | 478 int size; |
479 int mb_x, mb_y; | 479 int mb_x, mb_y; |
480 | 480 |
481 init_put_bits(&a->pb, buf, buf_size); | 481 init_put_bits(&a->pb, buf, buf_size); |
482 | 482 |
534 a->mb_width = (avctx->width + 15) / 16; | 534 a->mb_width = (avctx->width + 15) / 16; |
535 a->mb_height = (avctx->height + 15) / 16; | 535 a->mb_height = (avctx->height + 15) / 16; |
536 a->mb_width2 = (avctx->width + 0) / 16; | 536 a->mb_width2 = (avctx->width + 0) / 16; |
537 a->mb_height2 = (avctx->height + 0) / 16; | 537 a->mb_height2 = (avctx->height + 0) / 16; |
538 | 538 |
539 avctx->coded_frame= (AVFrame*)&a->picture; | 539 avctx->coded_frame= &a->picture; |
540 a->avctx= avctx; | 540 a->avctx= avctx; |
541 } | 541 } |
542 | 542 |
543 static av_cold int decode_init(AVCodecContext *avctx){ | 543 static av_cold int decode_init(AVCodecContext *avctx){ |
544 ASV1Context * const a = avctx->priv_data; | 544 ASV1Context * const a = avctx->priv_data; |
545 AVFrame *p= (AVFrame*)&a->picture; | 545 AVFrame *p= &a->picture; |
546 int i; | 546 int i; |
547 const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2; | 547 const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2; |
548 | 548 |
549 common_init(avctx); | 549 common_init(avctx); |
550 init_vlcs(a); | 550 init_vlcs(a); |
551 ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab); | 551 ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab); |
552 avctx->pix_fmt= PIX_FMT_YUV420P; | 552 avctx->pix_fmt= PIX_FMT_YUV420P; |
553 | 553 |
554 a->inv_qscale= ((uint8_t*)avctx->extradata)[0]; | 554 a->inv_qscale= avctx->extradata[0]; |
555 if(a->inv_qscale == 0){ | 555 if(a->inv_qscale == 0){ |
556 av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n"); | 556 av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n"); |
557 if(avctx->codec_id == CODEC_ID_ASV1) | 557 if(avctx->codec_id == CODEC_ID_ASV1) |
558 a->inv_qscale= 6; | 558 a->inv_qscale= 6; |
559 else | 559 else |