/*****************************************************************************
 "This software module was originally developed by Noboru Yamaguchi (TOSHIBA
  CORPORATION), Takashi Ida (TOSHIBA CORPORATION) and edited by Toshiaki
  Watanabe (TOSHIBA CORPORATION), Yoshihiro Kikuchi (TOSHIBA CORPORATION), in
  the course of development of the <MPEG-4 Video(ISO/IEC 14496-2)>. This
  software module is an implementation of a part of one or more <MPEG-4 Video
  (ISO/IEC 14496-2)> tools as specified by the <MPEG-4 Video(ISO/IEC 14496-2)
  >. ISO/IEC gives users of the <MPEG-4 Video(ISO/IEC 14496-2)> free license
  to this software module or modifications thereof for use in hardware or
  software products claiming conformance to the <MPEG-4 Video(ISO/IEC 14496-2
  )>. Those intending to use this software module in hardware or software
  products are advised that its use may infringe existing patents. The
  original developer of this software module and his/her company, the
  subsequent editors and their companies, and ISO/IEC have no liability for
  use of this software module or modifications thereof in an implementation.
  Copyright is not released for non <MPEG-4 Video(ISO/IEC 14496-2)>
  conforming products. TOSHIBA CORPORATION retains full right to use the code
  for his/her own purpose, assign or donate the code to a third party and to
  inhibit third parties from using the code for non <MPEG-4 Video(ISO/IEC
  14496-2)> conforming products. This copyright notice must be included in
  all copies or derivative works. Copyright (c)1996".
 *****************************************************************************/

/********* header ********/

#include<stdio.h>
#ifndef WIN32
#include<values.h>
#endif
#include <string.h>
#include "momusys.h"
#include "alp_common_def.h"
#include "alp_dec_util.h"

#define _DECODE_DEBUG

Int ConvertStoI(Char *bs, Int len)
{
	Int i, code = 0;

	for (i=0;i<len;i++) 
			code += (code+(bs[i]=='1'));
	return code;
}

Int StreamCompare(Char *buff, Char *orig, Int len)
{
  Int i, diff;

  diff = 0;
  i = 0;
  while (i < len) {
    diff = buff[i] + OFFSET - orig[i];
    if (diff != 0)
      i = len;
    i++;
  }
  return diff;
}
