result = decode_frame_header (&s->gb, s);
result = svq1_decode_frame_header (&s->gb, s);
static int svq1_decode_frame(AVCodecContext *avctx,                              void *data, int *data_size,                             UINT8 *buf, int buf_size){  MpegEncContext *s=avctx->priv_data;  uint8_t      *current, *previous;  int		result, i, x, y, width, height;  AVPicture *pict = data; //  memcpy(temp_buf,buffer,buffer_len); buffer=temp_buf;    /* initialize bit buffer */  init_get_bits(&s->gb,buf,buf_size);  /* decode frame header */  s->f_code = get_bits (&s->gb, 22);  if ((s->f_code & ~0x70) || !(s->f_code & 0x60))    return -1;  /* swap some header bytes (why?) */  if (s->f_code != 0x20) {    uint32_t *src = (uint32_t *) (buf + 4);    for (i=0; i < 4; i++) {      src[i] = ((src[i] << 16) | (src[i] >> 16)) ^ src[7 - i];    }  }  result = decode_frame_header (&s->gb, s);  if (result != 0)  {#ifdef DEBUG_SVQ1    printf("Error in decode_frame_header %i\n",result);#endif    return result;  }  /* decode y, u and v components */  for (i=0; i < 3; i++) {    if (i == 0) {      width  = s->width;      height = s->height;    } else {      width  = s->width/4;      height = s->height/4;    }    current  = s->current_picture[i];    previous = s->last_picture[i];    if (s->pict_type == SVQ1_FRAME_INTRA) {      /* keyframe */      for (y=0; y < height; y+=16) {	for (x=0; x < width; x+=16) {	  result = decode_svq1_block (&s->gb, &current[x], width, 1);	  if (result != 0)	  {#ifdef DEBUG_SVQ1	    printf("Error in decode_svq1_block %i (keyframe)\n",result);#endif	    return result;	  }	}	current += 16*width;      }    } else {      /* delta frame */      memset (s->opaque, 0, ((width / 8) + 3) * sizeof(svq1_pmv_t));      for (y=0; y < height; y+=16) {	for (x=0; x < width; x+=16) {	  result = decode_delta_block (&s->gb, &current[x], previous,				       width, s->opaque, x, y);	  if (result != 0)	  {#ifdef DEBUG_SVQ1    printf("Error in decode_delta_block %i\n",result);#endif	    return result;	  }	}	((svq1_pmv_t *)s->opaque)[0].x = 0;	((svq1_pmv_t *)s->opaque)[0].y = 0;	current += 16*width;      }    }  }  /* update backward reference frame */  if (!s->hurry_up)  {	pict->data[0] = s->current_picture[0];	pict->data[1] = s->current_picture[1];	pict->data[2] = s->current_picture[2];	pict->linesize[0] = s->width;	pict->linesize[1] = s->width / 4;	pict->linesize[2] = s->width / 4;	for(i=0;i<3;i++)	{	    uint8_t *tmp = s->last_picture[i];	    s->last_picture[i] = s->current_picture[i];	    s->current_picture[i] = tmp;	}    *data_size=1;  }  return 0;}