On Sat, Oct 06, 2012 at 02:10:48PM -0600, Nathan Caldwell wrote:
> From: Andrew D'Addesio <[email protected]>
> 
> Fully functional range decoder, tested against libopus's entdec.c
> 
> Includes opusrac-test in opusrac.c
> ---
>  libavcodec/Makefile  |    1 +
>  libavcodec/opusrac.c |  120 
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>  libavcodec/opusrac.h |   90 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 211 insertions(+)
>  create mode 100644 libavcodec/opusrac.c
>  create mode 100644 libavcodec/opusrac.h

Hmm, does not look bad, but why?  This is not functional standalone..

Find some formatting comments below...

> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -686,6 +686,7 @@ TESTPROGS = cabac                                         
>               \
>              golomb                                                      \
>              iirfilter                                                   \
>              rangecoder                                                  \
> +            opusrac                                                     \

order

> --- /dev/null
> +++ b/libavcodec/opusrac.c
> @@ -0,0 +1,120 @@
> +/*
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with Libav; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
> + */
> +#include "get_bits.h"
> +#include "opusrac.h"

Add an empty line between license block and #includes.

> +static void opus_rac_normalize_ref(OpusRangeCoder *rc)
> +{
> +    while (rc->range <= 1 << 23) {
> +        av_dlog(NULL, "--start-- value: %u\n          range: %u\n", 
> rc->value, rc->range);
> +        rc->value = ((rc->value << 8) | (255 - get_bits(&rc->gb, 8)))
> +                    & ((1u<<31)-1);

Give the operators some room to breathe.

> +        rc->range <<= 8;
> +        av_dlog(NULL, "--end--   value: %u\n          range: %u\n", 
> rc->value, rc->range);
> +        rc->total_read_bits += 8;
> +    }
> +}

Mind the line length please; in other places as well..

> +static void opus_rac_seek_ref(OpusRangeCoder *rc, unsigned int scale,
> +                                          unsigned int plow, unsigned int 
> phigh,
> +                                          unsigned int ptotal)

indentation

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to