*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
#define NDEBUG 1
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <assert.h>
#include <math.h>
-#include <vlc/vlc.h>
-#include <vlc/sout.h>
-#include <vlc/input.h>
+#include <vlc_common.h>
+#include <vlc_sout.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 */