/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
#define NDEBUG 1
#include <assert.h>
#include <math.h>
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include <vlc_sout.h>
-#include <<vlc_input.h>>
+#include <vlc_codec.h>
#include "transrate.h"
{
int new_level = new_blk->level;
int level = blk->level;
- if ( i1 > 64 || i2 > 64 || !blk->run || !new_blk->run ) return score;
+ if ( i1 > 64 || i2 > 64 || !blk->run || !new_blk->run ) return score;
if ( i1 + blk->run == i2 + new_blk->run )
{
- int64_t tmp = saturate(level * i_qscale)
+ int64_t tmp = saturate(level * i_qscale)
- saturate(new_level * i_qscale_new);
i1 += blk->run;
i2 += new_blk->run;
int scale_quant( transrate_t *tr, double qrate )
{
- int i_quant = (int)floor( tr->quantizer_scale * qrate + 0.5 );
+ int i_quant = floor( tr->quantizer_scale * qrate + 0.5 );
if ( tr->q_scale_type )
{
return i_quant;
}
-int increment_quant( transrate_t *tr, int i_quant )
+static int increment_quant( transrate_t *tr, int i_quant )
{
if ( tr->q_scale_type )
{
if (i < 64 ) goto normal_code;
}
fprintf(stderr, "Err in B14\n");
- tr->b_error = 1;
+ tr->b_error = 1;
break; /* illegal, check needed to avoid buffer overflow */
}
bs_flush( bs, 2 ); /* dump end of block code */
if (i < 64) goto normal_code;
}
fprintf(stderr, "Err in B15\n");
- tr->b_error = 1;
+ tr->b_error = 1;
break; /* illegal, check needed to avoid buffer overflow */
}
bs_flush( bs, 4 ); /* dump end of block code */
if (i < 64) goto normal_code;
}
fprintf(stderr, "Err in non-intra\n");
- tr->b_error = 1;
+ tr->b_error = 1;
break; /* illegal, check needed to avoid buffer overflow */
}
bs_flush( bs, 2 ); /* dump end of block code */