Mercurial > libavcodec.hg
comparison flacenc.c @ 12324:549a40628c70 libavcodec
cosmetics: line wrap and vertical alignment
author | jbr |
---|---|
date | Sat, 31 Jul 2010 17:07:24 +0000 |
parents | df22caaab59e |
children | 6da1651834cb |
comparison
equal
deleted
inserted
replaced
12323:df22caaab59e | 12324:549a40628c70 |
---|---|
862 for (i = levels-1; i >= 0; i--) { | 862 for (i = levels-1; i >= 0; i--) { |
863 order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1; | 863 order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1; |
864 if (order < 0) | 864 if (order < 0) |
865 order = 0; | 865 order = 0; |
866 encode_residual_lpc(res, smp, n, order+1, coefs[order], shift[order]); | 866 encode_residual_lpc(res, smp, n, order+1, coefs[order], shift[order]); |
867 bits[i] = find_subblock_rice_params(&sub->rc, min_porder, max_porder, | 867 bits[i] = find_subblock_rice_params(&sub->rc, min_porder, |
868 res, n, order+1, sub->obits, precision); | 868 max_porder, res, n, order+1, |
869 sub->obits, precision); | |
869 if (bits[i] < bits[opt_index]) { | 870 if (bits[i] < bits[opt_index]) { |
870 opt_index = i; | 871 opt_index = i; |
871 opt_order = order; | 872 opt_order = order; |
872 } | 873 } |
873 } | 874 } |
877 uint32_t bits[MAX_LPC_ORDER]; | 878 uint32_t bits[MAX_LPC_ORDER]; |
878 opt_order = 0; | 879 opt_order = 0; |
879 bits[0] = UINT32_MAX; | 880 bits[0] = UINT32_MAX; |
880 for (i = min_order-1; i < max_order; i++) { | 881 for (i = min_order-1; i < max_order; i++) { |
881 encode_residual_lpc(res, smp, n, i+1, coefs[i], shift[i]); | 882 encode_residual_lpc(res, smp, n, i+1, coefs[i], shift[i]); |
882 bits[i] = find_subblock_rice_params(&sub->rc, min_porder, max_porder, | 883 bits[i] = find_subblock_rice_params(&sub->rc, min_porder, |
883 res, n, i+1, sub->obits, precision); | 884 max_porder, res, n, i+1, |
885 sub->obits, precision); | |
884 if (bits[i] < bits[opt_order]) | 886 if (bits[i] < bits[opt_order]) |
885 opt_order = i; | 887 opt_order = i; |
886 } | 888 } |
887 opt_order++; | 889 opt_order++; |
888 } else if (omethod == ORDER_METHOD_LOG) { | 890 } else if (omethod == ORDER_METHOD_LOG) { |
896 int last = opt_order; | 898 int last = opt_order; |
897 for (i = last-step; i <= last+step; i += step) { | 899 for (i = last-step; i <= last+step; i += step) { |
898 if (i < min_order-1 || i >= max_order || bits[i] < UINT32_MAX) | 900 if (i < min_order-1 || i >= max_order || bits[i] < UINT32_MAX) |
899 continue; | 901 continue; |
900 encode_residual_lpc(res, smp, n, i+1, coefs[i], shift[i]); | 902 encode_residual_lpc(res, smp, n, i+1, coefs[i], shift[i]); |
901 bits[i] = find_subblock_rice_params(&sub->rc, min_porder, max_porder, | 903 bits[i] = find_subblock_rice_params(&sub->rc, min_porder, |
902 res, n, i+1, sub->obits, | 904 max_porder, res, n, i+1, |
903 precision); | 905 sub->obits, precision); |
904 if (bits[i] < bits[opt_order]) | 906 if (bits[i] < bits[opt_order]) |
905 opt_order = i; | 907 opt_order = i; |
906 } | 908 } |
907 } | 909 } |
908 opt_order++; | 910 opt_order++; |
916 sub->coefs[i] = coefs[sub->order-1][i]; | 918 sub->coefs[i] = coefs[sub->order-1][i]; |
917 | 919 |
918 encode_residual_lpc(res, smp, n, sub->order, sub->coefs, sub->shift); | 920 encode_residual_lpc(res, smp, n, sub->order, sub->coefs, sub->shift); |
919 | 921 |
920 return find_subblock_rice_params(&sub->rc, min_porder, max_porder, res, n, | 922 return find_subblock_rice_params(&sub->rc, min_porder, max_porder, res, n, |
921 sub->order, sub->obits, precision); | 923 sub->order, sub->obits, precision); |
922 } | 924 } |
923 | 925 |
924 | 926 |
925 static int count_frame_header(FlacEncodeContext *s) | 927 static int count_frame_header(FlacEncodeContext *s) |
926 { | 928 { |