~siretart/libav/merge.raring.libav-0.8.6

« back to all changes in this revision

Viewing changes to libavcodec/svq1dec.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:30:00 UTC
  • mfrom: (1.4.1)
  • mto: (1.3.11 sid) (26.1.1 quantal-security)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20120112223000-s1reiy1e28hnix42
Tags: upstream-0.8~beta2
ImportĀ upstreamĀ versionĀ 0.8~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
 
196
196
#define SVQ1_CALC_CODEBOOK_ENTRIES(cbook)\
197
197
      codebook = (const uint32_t *) cbook[level];\
198
 
      bit_cache = get_bits (bitbuf, 4*stages);\
 
198
      if (stages > 0)\
 
199
        bit_cache = get_bits (bitbuf, 4*stages);\
199
200
      /* calculate codebook entries for this vector */\
200
201
      for (j=0; j < stages; j++) {\
201
202
        entries[j] = (((bit_cache >> (4*(stages - j - 1))) & 0xF) + 16*j) << (level + 1);\
317
318
 
318
319
    /* add median of motion vector predictors and clip result */
319
320
    if (i == 1)
320
 
      mv->y = ((diff + mid_pred(pmv[0]->y, pmv[1]->y, pmv[2]->y)) << 26) >> 26;
 
321
      mv->y = sign_extend(diff + mid_pred(pmv[0]->y, pmv[1]->y, pmv[2]->y), 6);
321
322
    else
322
 
      mv->x = ((diff + mid_pred(pmv[0]->x, pmv[1]->x, pmv[2]->x)) << 26) >> 26;
 
323
      mv->x = sign_extend(diff + mid_pred(pmv[0]->x, pmv[1]->x, pmv[2]->x), 6);
323
324
  }
324
325
 
325
326
  return 0;
690
691
      linesize= s->uvlinesize;
691
692
    }
692
693
 
693
 
    current  = s->current_picture.data[i];
 
694
    current = s->current_picture.f.data[i];
694
695
 
695
696
    if(s->pict_type==AV_PICTURE_TYPE_B){
696
 
        previous = s->next_picture.data[i];
 
697
        previous = s->next_picture.f.data[i];
697
698
    }else{
698
 
        previous = s->last_picture.data[i];
 
699
        previous = s->last_picture.f.data[i];
699
700
    }
700
701
 
701
702
    if (s->pict_type == AV_PICTURE_TYPE_I) {
809
810
 
810
811
 
811
812
AVCodec ff_svq1_decoder = {
812
 
    "svq1",
813
 
    AVMEDIA_TYPE_VIDEO,
814
 
    CODEC_ID_SVQ1,
815
 
    sizeof(MpegEncContext),
816
 
    svq1_decode_init,
817
 
    NULL,
818
 
    svq1_decode_end,
819
 
    svq1_decode_frame,
820
 
    CODEC_CAP_DR1,
 
813
    .name           = "svq1",
 
814
    .type           = AVMEDIA_TYPE_VIDEO,
 
815
    .id             = CODEC_ID_SVQ1,
 
816
    .priv_data_size = sizeof(MpegEncContext),
 
817
    .init           = svq1_decode_init,
 
818
    .close          = svq1_decode_end,
 
819
    .decode         = svq1_decode_frame,
 
820
    .capabilities   = CODEC_CAP_DR1,
821
821
    .flush= ff_mpeg_flush,
822
822
    .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV410P, PIX_FMT_NONE},
823
823
    .long_name= NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),