Mercurial > libavcodec.hg
comparison wavpack.c @ 11212:4a0b77af9d9c libavcodec
cosmetics: reindent after last commit
author | kostya |
---|---|
date | Fri, 19 Feb 2010 14:06:12 +0000 |
parents | dfeaae916502 |
children | 8a4984c5cacc |
comparison
equal
deleted
inserted
replaced
11211:dfeaae916502 | 11212:4a0b77af9d9c |
---|---|
467 int16_t *dst16 = dst; | 467 int16_t *dst16 = dst; |
468 int32_t *dst32 = dst; | 468 int32_t *dst32 = dst; |
469 float *dstfl = dst; | 469 float *dstfl = dst; |
470 | 470 |
471 if(s->samples_left == s->samples) | 471 if(s->samples_left == s->samples) |
472 s->one = s->zero = s->zeroes = 0; | 472 s->one = s->zero = s->zeroes = 0; |
473 do{ | 473 do{ |
474 L = wv_get_value(s, gb, 0, &last); | 474 L = wv_get_value(s, gb, 0, &last); |
475 if(last) break; | 475 if(last) break; |
476 R = wv_get_value(s, gb, 1, &last); | 476 R = wv_get_value(s, gb, 1, &last); |
477 if(last) break; | 477 if(last) break; |
559 count++; | 559 count++; |
560 }while(!last && count < s->max_samples); | 560 }while(!last && count < s->max_samples); |
561 | 561 |
562 s->samples_left -= count; | 562 s->samples_left -= count; |
563 if(!s->samples_left){ | 563 if(!s->samples_left){ |
564 if(crc != s->CRC){ | 564 if(crc != s->CRC){ |
565 av_log(s->avctx, AV_LOG_ERROR, "CRC error\n"); | 565 av_log(s->avctx, AV_LOG_ERROR, "CRC error\n"); |
566 return -1; | 566 return -1; |
567 } | 567 } |
568 if(s->got_extra_bits && crc_extra_bits != s->crc_extra_bits){ | 568 if(s->got_extra_bits && crc_extra_bits != s->crc_extra_bits){ |
569 av_log(s->avctx, AV_LOG_ERROR, "Extra bits CRC error\n"); | 569 av_log(s->avctx, AV_LOG_ERROR, "Extra bits CRC error\n"); |
570 return -1; | 570 return -1; |
571 } | 571 } |
572 wv_reset_saved_context(s); | 572 wv_reset_saved_context(s); |
573 }else{ | 573 }else{ |
574 s->pos = pos; | 574 s->pos = pos; |
575 s->sc.crc = crc; | 575 s->sc.crc = crc; |
576 s->sc.bits_used = get_bits_count(&s->gb); | 576 s->sc.bits_used = get_bits_count(&s->gb); |
577 if(s->got_extra_bits){ | 577 if(s->got_extra_bits){ |
593 int16_t *dst16 = dst; | 593 int16_t *dst16 = dst; |
594 int32_t *dst32 = dst; | 594 int32_t *dst32 = dst; |
595 float *dstfl = dst; | 595 float *dstfl = dst; |
596 | 596 |
597 if(s->samples_left == s->samples) | 597 if(s->samples_left == s->samples) |
598 s->one = s->zero = s->zeroes = 0; | 598 s->one = s->zero = s->zeroes = 0; |
599 do{ | 599 do{ |
600 T = wv_get_value(s, gb, 0, &last); | 600 T = wv_get_value(s, gb, 0, &last); |
601 S = 0; | 601 S = 0; |
602 if(last) break; | 602 if(last) break; |
603 for(i = 0; i < s->terms; i++){ | 603 for(i = 0; i < s->terms; i++){ |
632 count++; | 632 count++; |
633 }while(!last && count < s->samples); | 633 }while(!last && count < s->samples); |
634 | 634 |
635 s->samples_left -= count; | 635 s->samples_left -= count; |
636 if(!s->samples_left){ | 636 if(!s->samples_left){ |
637 if(crc != s->CRC){ | 637 if(crc != s->CRC){ |
638 av_log(s->avctx, AV_LOG_ERROR, "CRC error\n"); | 638 av_log(s->avctx, AV_LOG_ERROR, "CRC error\n"); |
639 return -1; | 639 return -1; |
640 } | 640 } |
641 if(s->got_extra_bits && crc_extra_bits != s->crc_extra_bits){ | 641 if(s->got_extra_bits && crc_extra_bits != s->crc_extra_bits){ |
642 av_log(s->avctx, AV_LOG_ERROR, "Extra bits CRC error\n"); | 642 av_log(s->avctx, AV_LOG_ERROR, "Extra bits CRC error\n"); |
643 return -1; | 643 return -1; |
644 } | 644 } |
645 wv_reset_saved_context(s); | 645 wv_reset_saved_context(s); |
646 }else{ | 646 }else{ |
647 s->pos = pos; | 647 s->pos = pos; |
648 s->sc.crc = crc; | 648 s->sc.crc = crc; |
649 s->sc.bits_used = get_bits_count(&s->gb); | 649 s->sc.bits_used = get_bits_count(&s->gb); |
650 if(s->got_extra_bits){ | 650 if(s->got_extra_bits){ |
691 *data_size = 0; | 691 *data_size = 0; |
692 return 0; | 692 return 0; |
693 } | 693 } |
694 | 694 |
695 if(!s->samples_left){ | 695 if(!s->samples_left){ |
696 memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr)); | 696 memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr)); |
697 memset(s->ch, 0, sizeof(s->ch)); | 697 memset(s->ch, 0, sizeof(s->ch)); |
698 s->extra_bits = 0; | 698 s->extra_bits = 0; |
699 s->and = s->or = s->shift = 0; | 699 s->and = s->or = s->shift = 0; |
700 s->got_extra_bits = 0; | 700 s->got_extra_bits = 0; |
701 } | 701 } |
702 | 702 |
703 s->samples = AV_RL32(buf); buf += 4; | 703 s->samples = AV_RL32(buf); buf += 4; |
704 if(!s->samples){ | 704 if(!s->samples){ |
705 *data_size = 0; | 705 *data_size = 0; |
919 buf += size; | 919 buf += size; |
920 } | 920 } |
921 if(id & WP_IDF_ODD) buf++; | 921 if(id & WP_IDF_ODD) buf++; |
922 } | 922 } |
923 if(!s->samples_left){ | 923 if(!s->samples_left){ |
924 if(!got_terms){ | 924 if(!got_terms){ |
925 av_log(avctx, AV_LOG_ERROR, "No block with decorrelation terms\n"); | 925 av_log(avctx, AV_LOG_ERROR, "No block with decorrelation terms\n"); |
926 return -1; | 926 return -1; |
927 } | 927 } |
928 if(!got_weights){ | 928 if(!got_weights){ |
929 av_log(avctx, AV_LOG_ERROR, "No block with decorrelation weights\n"); | 929 av_log(avctx, AV_LOG_ERROR, "No block with decorrelation weights\n"); |
930 return -1; | 930 return -1; |
931 } | 931 } |
932 if(!got_samples){ | 932 if(!got_samples){ |
933 av_log(avctx, AV_LOG_ERROR, "No block with decorrelation samples\n"); | 933 av_log(avctx, AV_LOG_ERROR, "No block with decorrelation samples\n"); |
934 return -1; | 934 return -1; |
935 } | 935 } |
936 if(!got_entropy){ | 936 if(!got_entropy){ |
937 av_log(avctx, AV_LOG_ERROR, "No block with entropy info\n"); | 937 av_log(avctx, AV_LOG_ERROR, "No block with entropy info\n"); |
938 return -1; | 938 return -1; |
939 } | 939 } |
940 if(s->hybrid && !got_hybrid){ | 940 if(s->hybrid && !got_hybrid){ |
941 av_log(avctx, AV_LOG_ERROR, "Hybrid config not found\n"); | 941 av_log(avctx, AV_LOG_ERROR, "Hybrid config not found\n"); |
942 return -1; | 942 return -1; |
943 } | 943 } |
944 if(!got_bs){ | 944 if(!got_bs){ |
945 av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n"); | 945 av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n"); |
946 return -1; | 946 return -1; |
947 } | 947 } |
948 if(!got_float && avctx->sample_fmt == SAMPLE_FMT_FLT){ | 948 if(!got_float && avctx->sample_fmt == SAMPLE_FMT_FLT){ |
949 av_log(avctx, AV_LOG_ERROR, "Float information not found\n"); | 949 av_log(avctx, AV_LOG_ERROR, "Float information not found\n"); |
950 return -1; | 950 return -1; |
951 } | 951 } |
952 if(s->got_extra_bits && avctx->sample_fmt != SAMPLE_FMT_FLT){ | 952 if(s->got_extra_bits && avctx->sample_fmt != SAMPLE_FMT_FLT){ |
953 const int size = get_bits_left(&s->gb_extra_bits); | 953 const int size = get_bits_left(&s->gb_extra_bits); |
954 const int wanted = s->samples * s->extra_bits << s->stereo_in; | 954 const int wanted = s->samples * s->extra_bits << s->stereo_in; |
955 if(size < wanted){ | 955 if(size < wanted){ |
956 av_log(avctx, AV_LOG_ERROR, "Too small EXTRABITS\n"); | 956 av_log(avctx, AV_LOG_ERROR, "Too small EXTRABITS\n"); |
957 s->got_extra_bits = 0; | 957 s->got_extra_bits = 0; |
958 } | 958 } |
959 } | 959 } |
960 s->samples_left = s->samples; | 960 s->samples_left = s->samples; |
961 }else{ | 961 }else{ |
962 init_get_bits(&s->gb, avpkt->data + s->sc.offset, s->sc.size); | 962 init_get_bits(&s->gb, avpkt->data + s->sc.offset, s->sc.size); |
963 skip_bits_long(&s->gb, s->sc.bits_used); | 963 skip_bits_long(&s->gb, s->sc.bits_used); |
964 if(s->got_extra_bits){ | 964 if(s->got_extra_bits){ |
965 init_get_bits(&s->gb_extra_bits, avpkt->data + s->extra_sc.offset, | 965 init_get_bits(&s->gb_extra_bits, avpkt->data + s->extra_sc.offset, |