Revision 56d9b943 libavcodec/indeo3.c

View differences:

libavcodec/indeo3.c
69 69
  s->ModPred = av_malloc(8 * 128);
70 70

  
71 71
  for (i=0; i < 128; ++i) {
72
    s->ModPred[i+0*128] = (i > 126) ? 254 : 2*((i + 1) - ((i + 1) % 2));
73
    s->ModPred[i+1*128] = (i == 7)  ?  20 : ((i == 119 || i == 120)
74
                                 ? 236 : 2*((i + 2) - ((i + 1) % 3)));
75
    s->ModPred[i+2*128] = (i > 125) ? 248 : 2*((i + 2) - ((i + 2) % 4));
76
    s->ModPred[i+3*128] =                        2*((i + 1) - ((i - 3) % 5));
77
    s->ModPred[i+4*128] = (i == 8)  ?  20 : 2*((i + 1) - ((i - 3) % 6));
78
    s->ModPred[i+5*128] =                        2*((i + 4) - ((i + 3) % 7));
79
    s->ModPred[i+6*128] = (i > 123) ? 240 : 2*((i + 4) - ((i + 4) % 8));
80
    s->ModPred[i+7*128] =                        2*((i + 5) - ((i + 4) % 9));
72
    s->ModPred[i+0*128] = i >  126 ? 254 : 2*(i + 1 - ((i + 1) % 2));
73
    s->ModPred[i+1*128] = i ==   7 ?  20 :
74
                          i == 119 ||
75
                          i == 120 ? 236 : 2*(i + 2 - ((i + 1) % 3));
76
    s->ModPred[i+2*128] = i >  125 ? 248 : 2*(i + 2 - ((i + 2) % 4));
77
    s->ModPred[i+3*128] =                  2*(i + 1 - ((i - 3) % 5));
78
    s->ModPred[i+4*128] = i ==   8 ?  20 : 2*(i + 1 - ((i - 3) % 6));
79
    s->ModPred[i+5*128] =                  2*(i + 4 - ((i + 3) % 7));
80
    s->ModPred[i+6*128] = i >  123 ? 240 : 2*(i + 4 - ((i + 4) % 8));
81
    s->ModPred[i+7*128] =                  2*(i + 5 - ((i + 4) % 9));
81 82
  }
82 83

  
83 84
  s->corrector_type = av_malloc(24 * 256);
84 85

  
85 86
  for (i=0; i < 24; ++i) {
86 87
    for (j=0; j < 256; ++j) {
87
      s->corrector_type[i*256+j] = (j < corrector_type_0[i])
88
                                ? 1 : ((j < 248 || (i == 16 && j == 248))
89
                                       ? 0 : corrector_type_2[j - 248]);
88
      s->corrector_type[i*256+j] = j < corrector_type_0[i]          ? 1 :
89
                                   j < 248 || (i == 16 && j == 248) ? 0 :
90
                                   corrector_type_2[j - 248];
90 91
    }
91 92
  }
92 93
}

Also available in: Unified diff