Revision faa7e394

View differences:

libavcodec/h264.c
207 207
    }
208 208

  
209 209
    if(IS_INTRA(mb_type)){
210
        int type_mask= h->pps.constrained_intra_pred ? IS_INTRA(-1) : -1;
210 211
        h->topleft_samples_available=
211 212
        h->top_samples_available=
212 213
        h->left_samples_available= 0xFFFF;
213 214
        h->topright_samples_available= 0xEEEA;
214 215

  
215
        if(!IS_INTRA(top_type) && (top_type==0 || h->pps.constrained_intra_pred)){
216
        if(!(top_type & type_mask)){
216 217
            h->topleft_samples_available= 0xB3FF;
217 218
            h->top_samples_available= 0x33FF;
218 219
            h->topright_samples_available= 0x26EA;
219 220
        }
220 221
        if(IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[0])){
221 222
            if(IS_INTERLACED(mb_type)){
222
                if(!IS_INTRA(left_type[0]) && (left_type[0]==0 || h->pps.constrained_intra_pred)){
223
                if(!(left_type[0] & type_mask)){
223 224
                    h->topleft_samples_available&= 0xDFFF;
224 225
                    h->left_samples_available&= 0x5FFF;
225 226
                }
226
                if(!IS_INTRA(left_type[1]) && (left_type[1]==0 || h->pps.constrained_intra_pred)){
227
                if(!(left_type[1] & type_mask)){
227 228
                    h->topleft_samples_available&= 0xFF5F;
228 229
                    h->left_samples_available&= 0xFF5F;
229 230
                }
......
231 232
                int left_typei = h->slice_table[left_xy[0] + s->mb_stride ] == h->slice_num
232 233
                                ? s->current_picture.mb_type[left_xy[0] + s->mb_stride] : 0;
233 234
                assert(left_xy[0] == left_xy[1]);
234
                if(!(IS_INTRA(left_typei) && IS_INTRA(left_type[0])) && (left_typei==0 || h->pps.constrained_intra_pred)){
235
                if(!((left_typei & type_mask) && (left_type[0] & type_mask))){
235 236
                    h->topleft_samples_available&= 0xDF5F;
236 237
                    h->left_samples_available&= 0x5F5F;
237 238
                }
238 239
            }
239 240
        }else{
240
            if(!IS_INTRA(left_type[0]) && (left_type[0]==0 || h->pps.constrained_intra_pred)){
241
            if(!(left_type[0] & type_mask)){
241 242
                h->topleft_samples_available&= 0xDF5F;
242 243
                h->left_samples_available&= 0x5F5F;
243 244
            }
244 245
        }
245 246

  
246
        if(!IS_INTRA(topleft_type) && (topleft_type==0 || h->pps.constrained_intra_pred))
247
        if(!(topleft_type & type_mask))
247 248
            h->topleft_samples_available&= 0x7FFF;
248 249

  
249
        if(!IS_INTRA(topright_type) && (topright_type==0 || h->pps.constrained_intra_pred))
250
        if(!(topright_type & type_mask))
250 251
            h->topright_samples_available&= 0xFBFF;
251 252

  
252 253
        if(IS_INTRA4x4(mb_type)){
......
257 258
                h->intra4x4_pred_mode_cache[7+8*0]= h->intra4x4_pred_mode[top_xy][3];
258 259
            }else{
259 260
                int pred;
260
                if(!top_type || (IS_INTER(top_type) && h->pps.constrained_intra_pred))
261
                if(!(top_type & type_mask))
261 262
                    pred= -1;
262 263
                else{
263 264
                    pred= 2;
......
273 274
                    h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= h->intra4x4_pred_mode[left_xy[i]][left_block[1+2*i]];
274 275
                }else{
275 276
                    int pred;
276
                    if(!left_type[i] || (IS_INTER(left_type[i]) && h->pps.constrained_intra_pred))
277
                    if(!(left_type[i] & type_mask))
277 278
                        pred= -1;
278 279
                    else{
279 280
                        pred= 2;

Also available in: Unified diff