static int h263p_decode_umotion(MpegEncContext * s, int pred)

{

   int code = 0, sign;



   if (get_bits1(&s->gb)) /* Motion difference = 0 */

      return pred;



   code = 2 + get_bits1(&s->gb);



   while (get_bits1(&s->gb))

   {

      code <<= 1;

      code += get_bits1(&s->gb);

      if (code >= 32768) {

          avpriv_request_sample(s->avctx, "Huge DMV");

          return AVERROR_INVALIDDATA;

      }

   }

   sign = code & 1;

   code >>= 1;



   code = (sign) ? (pred - code) : (pred + code);

   ff_tlog(s->avctx,"H.263+ UMV Motion = %d\n", code);

   return code;



}

static int h263p_decode_umotion(MpegEncContext * s, int pred)

{

   int code = 0, sign;



   if (get_bits1(&s->gb)) 

      return pred;



   code = 2 + get_bits1(&s->gb);



   while (get_bits1(&s->gb))

   {

      code <<= 1;

      code += get_bits1(&s->gb);

      if (code >= 32768) {

          avpriv_request_sample(s->avctx, "Huge DMV");

          return AVERROR_INVALIDDATA;

      }

   }

   sign = code & 1;

   code >>= 1;



   code = (sign) ? (pred - code) : (pred + code);

   ff_tlog(s->avctx,"H.263+ UMV Motion = %d\n", code);

   return code;



}

          return AVERROR_INVALIDDATA;
static int FUNC_0(MpegEncContext * VAR_0, int VAR_1)

{

   int VAR_2 = 0, VAR_3;



   if (get_bits1(&VAR_0->gb)) 

      return VAR_1;



   VAR_2 = 2 + get_bits1(&VAR_0->gb);



   while (get_bits1(&VAR_0->gb))

   {

      VAR_2 <<= 1;

      VAR_2 += get_bits1(&VAR_0->gb);

      if (VAR_2 >= 32768) {

          avpriv_request_sample(VAR_0->avctx, "Huge DMV");

          return AVERROR_INVALIDDATA;

      }

   }

   VAR_3 = VAR_2 & 1;

   VAR_2 >>= 1;



   VAR_2 = (VAR_3) ? (VAR_1 - VAR_2) : (VAR_1 + VAR_2);

   ff_tlog(VAR_0->avctx,"H.263+ UMV Motion = %d\n", VAR_2);

   return VAR_2;



}

static int FUNC_0(MpegEncContext * VAR_0, int VAR_1)
{ int VAR_2 = 0, VAR_3; if (get_bits1(&VAR_0->gb))
return VAR_1; VAR_2 = 2 + get_bits1(&VAR_0->gb); while (get_bits1(&VAR_0->gb))
{ VAR_2 <<= 1; VAR_2 += get_bits1(&VAR_0->gb); if (VAR_2 >= 32768) { avpriv_request_sample(VAR_0->avctx, "Huge DMV"); return AVERROR_INVALIDDATA; } } VAR_3 = VAR_2 & 1; VAR_2 >>= 1; VAR_2 = (VAR_3) ? (VAR_1 - VAR_2) : (VAR_1 + VAR_2); ff_tlog(VAR_0->avctx,"H.263+ UMV Motion = %d\n", VAR_2); return VAR_2; }