Skip to content

Can a frame use as reference a restricted picture with a non valid resolution ? #5334

Description

@forayr

What version / commit were you testing with?

AVM v1.0

What is the problem?

For frame with implicit ref_frame_map, at the end of av2_get_ref_frames() (or get_ref_frames() in the spec), restricted reference pictures are added to remapped_ref_idx[]. When adding these frames, valid_ref_frame_size() is not called to check if the reference has a valid resolution even if resolution_available == 1, so the compliance of the scaling of restricted reference pictures is not checked.

However, later in read_uncompressed_frame(), the scale factors of each reference frame is checked, even if the reference is a restricted frame.

    if (!(current_frame->frame_type == INTRA_ONLY_FRAME) &&            
        pbi->need_resync != 1) {                                       
      for (int i = 0; i < cm->ref_frames_info.num_total_refs; ++i) {   
        const RefCntBuffer *const ref_buf = get_ref_frame_buf(cm, i);  
        if (!ref_buf) continue;                                        
        struct scale_factors *const ref_scale_factors =                
            get_ref_scale_factors(cm, i);                              
        av2_setup_scale_factors_for_frame(                             
            ref_scale_factors, ref_buf->buf.y_crop_width,              
            ref_buf->buf.y_crop_height, cm->width, cm->height);        
            ref_scale_factors->y_scale_fp);                            
        if ((!av2_is_valid_scale(ref_scale_factors)))                  
          avm_internal_error(&cm->error, AVM_CODEC_UNSUP_BITSTREAM,    
                             "Reference frame has invalid dimensions");
      }

It is then possible to generate a stream, especially when explicit_ref_frame_map = 0, that automatically add non valid restricted reference pictures, and which trigger this compliance check.

Am I missing an other specific compliance constraint ?

Else I think that either av2_get_ref_frames() should only add valid restricted frame, or that the compliance check should ignore restricted picture.

Additional information

Any other context / info that maybe useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions