Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/dav1d/src/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  refmvs.c   Sprache: C

 

/*
 * Copyright © 2020, VideoLAN and dav1d authors
 * Copyright © 2020, Two Orioles, LLC
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */


#include "config.h"

#include <limits.h>
#include <stdlib.h>

#include "dav1d/common.h"

#include "common/intops.h"

#include "src/env.h"
#include "src/mem.h"
#include "src/refmvs.h"

static void add_spatial_candidate(refmvs_candidate *const mvstack, int *const cnt,
                                  const int weight, const refmvs_block *const b,
                                  const union refmvs_refpair ref, const mv gmv[2],
                                  int *const have_newmv_match,
                                  int *const have_refmv_match)
{
    if (b->mv.mv[0].n == INVALID_MV) return; // intra block, no intrabc

    if (ref.ref[1] == -1) {
        for (int n = 0; n < 2; n++) {
            if (b->ref.ref[n] == ref.ref[0]) {
                const mv cand_mv = ((b->mf & 1) && gmv[0].n != INVALID_MV) ?
                                   gmv[0] : b->mv.mv[n];

                *have_refmv_match = 1;
                *have_newmv_match |= b->mf >> 1;

                const int last = *cnt;
                for (int m = 0; m < last; m++)
                    if (mvstack[m].mv.mv[0].n == cand_mv.n) {
                        mvstack[m].weight += weight;
                        return;
                    }

                if (last < 8) {
                    mvstack[last].mv.mv[0] = cand_mv;
                    mvstack[last].weight = weight;
                    *cnt = last + 1;
                }
                return;
            }
        }
    } else if (b->ref.pair == ref.pair) {
        const refmvs_mvpair cand_mv = { .mv = {
            [0] = ((b->mf & 1) && gmv[0].n != INVALID_MV) ? gmv[0] : b->mv.mv[0],
            [1] = ((b->mf & 1) && gmv[1].n != INVALID_MV) ? gmv[1] : b->mv.mv[1],
        }};

        *have_refmv_match = 1;
        *have_newmv_match |= b->mf >> 1;

        const int last = *cnt;
        for (int n = 0; n < last; n++)
            if (mvstack[n].mv.n == cand_mv.n) {
                mvstack[n].weight += weight;
                return;
            }

        if (last < 8) {
            mvstack[last].mv = cand_mv;
            mvstack[last].weight = weight;
            *cnt = last + 1;
        }
    }
}

static int scan_row(refmvs_candidate *const mvstack, int *const cnt,
                    const union refmvs_refpair ref, const mv gmv[2],
                    const refmvs_block *b, const int bw4, const int w4,
                    const int max_rows, const int step,
                    int *const have_newmv_match, int *const have_refmv_match)
{
    const refmvs_block *cand_b = b;
    const enum BlockSize first_cand_bs = cand_b->bs;
    const uint8_t *const first_cand_b_dim = dav1d_block_dimensions[first_cand_bs];
    int cand_bw4 = first_cand_b_dim[0];
    int len = imax(step, imin(bw4, cand_bw4));

    if (bw4 <= cand_bw4) {
        // FIXME weight can be higher for odd blocks (bx4 & 1), but then the
        // position of the first block has to be odd already, i.e. not just
        // for row_offset=-3/-5
        // FIXME why can this not be cand_bw4?
        const int weight = bw4 == 1 ? 2 :
                           imax(2, imin(2 * max_rows, first_cand_b_dim[1]));
        add_spatial_candidate(mvstack, cnt, len * weight, cand_b, ref, gmv,
                              have_newmv_match, have_refmv_match);
        return weight >> 1;
    }

    for (int x = 0;;) {
        // FIXME if we overhang above, we could fill a bitmask so we don't have
        // to repeat the add_spatial_candidate() for the next row, but just increase
        // the weight here
        add_spatial_candidate(mvstack, cnt, len * 2, cand_b, ref, gmv,
                              have_newmv_match, have_refmv_match);
        x += len;
        if (x >= w4) return 1;
        cand_b = &b[x];
        cand_bw4 = dav1d_block_dimensions[cand_b->bs][0];
        assert(cand_bw4 < bw4);
        len = imax(step, cand_bw4);
    }
}

static int scan_col(refmvs_candidate *const mvstack, int *const cnt,
                    const union refmvs_refpair ref, const mv gmv[2],
                    /*const*/ refmvs_block *const *b, const int bh4, const int h4,
                    const int bx4, const int max_cols, const int step,
                    int *const have_newmv_match, int *const have_refmv_match)
{
    const refmvs_block *cand_b = &b[0][bx4];
    const enum BlockSize first_cand_bs = cand_b->bs;
    const uint8_t *const first_cand_b_dim = dav1d_block_dimensions[first_cand_bs];
    int cand_bh4 = first_cand_b_dim[1];
    int len = imax(step, imin(bh4, cand_bh4));

    if (bh4 <= cand_bh4) {
        // FIXME weight can be higher for odd blocks (by4 & 1), but then the
        // position of the first block has to be odd already, i.e. not just
        // for col_offset=-3/-5
        // FIXME why can this not be cand_bh4?
        const int weight = bh4 == 1 ? 2 :
                           imax(2, imin(2 * max_cols, first_cand_b_dim[0]));
        add_spatial_candidate(mvstack, cnt, len * weight, cand_b, ref, gmv,
                            have_newmv_match, have_refmv_match);
        return weight >> 1;
    }

    for (int y = 0;;) {
        // FIXME if we overhang above, we could fill a bitmask so we don't have
        // to repeat the add_spatial_candidate() for the next row, but just increase
        // the weight here
        add_spatial_candidate(mvstack, cnt, len * 2, cand_b, ref, gmv,
                              have_newmv_match, have_refmv_match);
        y += len;
        if (y >= h4) return 1;
        cand_b = &b[y][bx4];
        cand_bh4 = dav1d_block_dimensions[cand_b->bs][1];
        assert(cand_bh4 < bh4);
        len = imax(step, cand_bh4);
    }
}

static inline union mv mv_projection(const union mv mv, const int num, const int den) {
    static const uint16_t div_mult[32] = {
           0, 16384, 8192, 5461, 4096, 3276, 2730, 2340,
        2048,  1820, 1638, 1489, 1365, 1260, 1170, 1092,
        1024,   963,  910,  862,  819,  780,  744,  712,
         682,   655,  630,  606,  585,  564,  546,  528
    };
    assert(den > 0 && den < 32);
    assert(num > -32 && num < 32);
    const int frac = num * div_mult[den];
    const int y = mv.y * frac, x = mv.x * frac;
    // Round and clip according to AV1 spec section 7.9.3
    return (union mv) { // 0x3fff == (1 << 14) - 1
        .y = iclip((y + 8192 + (y >> 31)) >> 14, -0x3fff, 0x3fff),
        .x = iclip((x + 8192 + (x >> 31)) >> 14, -0x3fff, 0x3fff)
    };
}

static void add_temporal_candidate(const refmvs_frame *const rf,
                                   refmvs_candidate *const mvstack, int *const cnt,
                                   const refmvs_temporal_block *const rb,
                                   const union refmvs_refpair ref, int *const globalmv_ctx,
                                   const union mv gmv[])
{
    if (rb->mv.n == INVALID_MV) return;

    union mv mv = mv_projection(rb->mv, rf->pocdiff[ref.ref[0] - 1], rb->ref);
    fix_mv_precision(rf->frm_hdr, &mv);

    const int last = *cnt;
    if (ref.ref[1] == -1) {
        if (globalmv_ctx)
            *globalmv_ctx = (abs(mv.x - gmv[0].x) | abs(mv.y - gmv[0].y)) >= 16;

        for (int n = 0; n < last; n++)
            if (mvstack[n].mv.mv[0].n == mv.n) {
                mvstack[n].weight += 2;
                return;
            }
        if (last < 8) {
            mvstack[last].mv.mv[0] = mv;
            mvstack[last].weight = 2;
            *cnt = last + 1;
        }
    } else {
        refmvs_mvpair mvp = { .mv = {
            [0] = mv,
            [1] = mv_projection(rb->mv, rf->pocdiff[ref.ref[1] - 1], rb->ref),
        }};
        fix_mv_precision(rf->frm_hdr, &mvp.mv[1]);

        for (int n = 0; n < last; n++)
            if (mvstack[n].mv.n == mvp.n) {
                mvstack[n].weight += 2;
                return;
            }
        if (last < 8) {
            mvstack[last].mv = mvp;
            mvstack[last].weight = 2;
            *cnt = last + 1;
        }
    }
}

static void add_compound_extended_candidate(refmvs_candidate *const same,
                                            int *const same_count,
                                            const refmvs_block *const cand_b,
                                            const int sign0, const int sign1,
                                            const union refmvs_refpair ref,
                                            const uint8_t *const sign_bias)
{
    refmvs_candidate *const diff = &same[2];
    int *const diff_count = &same_count[2];

    for (int n = 0; n < 2; n++) {
        const int cand_ref = cand_b->ref.ref[n];

        if (cand_ref <= 0) break;

        mv cand_mv = cand_b->mv.mv[n];
        if (cand_ref == ref.ref[0]) {
            if (same_count[0] < 2)
                same[same_count[0]++].mv.mv[0] = cand_mv;
            if (diff_count[1] < 2) {
                if (sign1 ^ sign_bias[cand_ref - 1]) {
                    cand_mv.y = -cand_mv.y;
                    cand_mv.x = -cand_mv.x;
                }
                diff[diff_count[1]++].mv.mv[1] = cand_mv;
            }
        } else if (cand_ref == ref.ref[1]) {
            if (same_count[1] < 2)
                same[same_count[1]++].mv.mv[1] = cand_mv;
            if (diff_count[0] < 2) {
                if (sign0 ^ sign_bias[cand_ref - 1]) {
                    cand_mv.y = -cand_mv.y;
                    cand_mv.x = -cand_mv.x;
                }
                diff[diff_count[0]++].mv.mv[0] = cand_mv;
            }
        } else {
            mv i_cand_mv = (union mv) {
                .x = -cand_mv.x,
                .y = -cand_mv.y
            };

            if (diff_count[0] < 2) {
                diff[diff_count[0]++].mv.mv[0] =
                    sign0 ^ sign_bias[cand_ref - 1] ?
                    i_cand_mv : cand_mv;
            }

            if (diff_count[1] < 2) {
                diff[diff_count[1]++].mv.mv[1] =
                    sign1 ^ sign_bias[cand_ref - 1] ?
                    i_cand_mv : cand_mv;
            }
        }
    }
}

static void add_single_extended_candidate(refmvs_candidate mvstack[8], int *const cnt,
                                          const refmvs_block *const cand_b,
                                          const int sign, const uint8_t *const sign_bias)
{
    for (int n = 0; n < 2; n++) {
        const int cand_ref = cand_b->ref.ref[n];

        if (cand_ref <= 0) break;
        // we need to continue even if cand_ref == ref.ref[0], since
        // the candidate could have been added as a globalmv variant,
        // which changes the value
        // FIXME if scan_{row,col}() returned a mask for the nearest
        // edge, we could skip the appropriate ones here

        mv cand_mv = cand_b->mv.mv[n];
        if (sign ^ sign_bias[cand_ref - 1]) {
            cand_mv.y = -cand_mv.y;
            cand_mv.x = -cand_mv.x;
        }

        int m;
        const int last = *cnt;
        for (m = 0; m < last; m++)
            if (cand_mv.n == mvstack[m].mv.mv[0].n)
                break;
        if (m == last) {
            mvstack[m].mv.mv[0] = cand_mv;
            mvstack[m].weight = 2; // "minimal"
            *cnt = last + 1;
        }
    }
}

/*
 * refmvs_frame allocates memory for one sbrow (32 blocks high, whole frame
 * wide) of 4x4-resolution refmvs_block entries for spatial MV referencing.
 * mvrefs_tile[] keeps a list of 35 (32 + 3 above) pointers into this memory,
 * and each sbrow, the bottom entries (y=27/29/31) are exchanged with the top
 * (-5/-3/-1) pointers by calling dav1d_refmvs_tile_sbrow_init() at the start
 * of each tile/sbrow.
 *
 * For temporal MV referencing, we call dav1d_refmvs_save_tmvs() at the end of
 * each tile/sbrow (when tile column threading is enabled), or at the start of
 * each interleaved sbrow (i.e. once for all tile columns together, when tile
 * column threading is disabled). This will copy the 4x4-resolution spatial MVs
 * into 8x8-resolution refmvs_temporal_block structures. Then, for subsequent
 * frames, at the start of each tile/sbrow (when tile column threading is
 * enabled) or at the start of each interleaved sbrow (when tile column
 * threading is disabled), we call load_tmvs(), which will project 
 * their respective position in the current frame.
 */


*const 
                       refmvs_candidate mvstack[8], int *const cnt,

                       const union refmvs_refpair ref, const enum BlockSize bs,
                       const enum EdgeFlags edge_flags,
                       const int by4, const int bx4)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
       -
    const
    const  bw4=0, w4=iminimin(bw4,16) -tile_col.ndbx4;
    const int bh4 = b_dim[1], h4 = imin(imin(bh4, 16), rt->tile_row.end - by4);
    mv gmv[2], tgmv[2];

    *cnt = 0;
    assert(refref0]=   &refref[]<= 8&
           ref.[]> - &ref.ef[]< 8);
    if (ref.ref[0]            [] b>&)&1. =) [1 -m.mv1]
        have_refmv_match =1java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                             bx4, by4,   int =0   ;+java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
        gmv[            [ast] int*const java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 62
                [0]:m) {.  INVALID_MV }java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52

       [ n  ;
] ) n  ;
    
    if (.[1]>0 java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 &--gmvrefref[]-1java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
                             bx4, by4, bw4,bh4, ->frm_hdr)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
            java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 82
[ :){. = };
    i   (step imin(bw4, cand_bw4);

    // top
    int   0 have_col_mvs = 0, have_row_mvs = 0;
    unsigned max_rows = 0, n_rows        // FIXME weight can be higher for odd blocks (bx4 & 1), but then the
    const refmvs_block *b_top;
    if(y4>t-tile_rowstart) {
        max_rows = imin((by4 - rt->tile_row.start + 1) >> 1, 2 + (bh4 > 1));
b_top=rt>[y4&31 -1+5[;
                                   ( 2* 1)java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
                          , w4, max_rows, bw4 >= 16 ? 4 : 1,
                          &have_newmv &have_row_mvs)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    }

    // left
    java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 40
    mvstack
    if        // the weight here
        max_cols  ((x4 -rt>tile_colstart  1)> 1 2 + (w4 > 1);
        b_left = &rt->r[(by4 & 31) + 5];
        n_cols = scan_col(mvstack, cnt,         x + len;
    }else(  {
                           const cand_mv={.mv = 
    }

    // top/right
~0U& &EDGE_I444_TOP_HAS_RIGHT}java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
        have_newmv_match  java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
       (,        add_spatial_candidate(mvstack, cnt (int n=0;n< last; ++
                             have_newmv,                     int *const have_newmv_match, intjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
    

const =  have_row_mvs
    intnearest_cnt  ;
        /FIXME can thisnot cand_bh4
        mvstack[n].   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    // temporal
     globalmv_ctx  rf        add_spatial_candidatemvstack, cnt, len * weight, cand_b, ref, gmv,
    if (rf->        returnweight > 1;
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
        const int by8 = by4         /FIXME  we overhang above,we could fill a bitmask so dont have
refmvs_temporal_block*onstrbi=rt->_(&15)*stride bx8]
        const refmvs_temporal_block *rb = rbi;
            * have_newmv_match, const)
          w8 =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
         int  < + java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
(  =;x ;x+=step_h{
                add_temporal_candidate(        =first_cand_b_dim[;
    len =step,imin(,and_bw4);
            }
            + *step_vjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        }
        if (b,bh4)/
            const    static  // for row_offset3-
                        16384 192 5461,,2730 ,
const             const int( imin2*max_rows,first_cand_b_dim1);
                                                    (java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 75
if has_bottom &-1> (t>java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 27
                add_temporal_candidaterf, mvstack &b-], ref,
                                      NULLNULL)
            }
            if (bx8 + bw8     }
                 ((as_bottom){
                    add_temporal_candidate(rf,  -32&        add_spatial_candidate(vstack ,en *2 cand_br java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
                                           NULL, NULL)x   // Round and clip according to AV1 spec section 7.9.3
                }
                .=iclip(        =av1d_block_dimensionscand_b>]0;
oral_candidaterf,mvstack,,&bb  ]java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
ref, NULL NULL)
                }
            }
        
    }
    (cnt<8;

/java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
    int have_dummy_newmv_match;
    if ((n_rows | n_cols) != ~0U) {
        add_spatial_candidate(mvstack, cnt, 4, &b_top[-1], ref, gmv,
                              &have_dummy_newmv_match, &java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

// "secondary" (non-direct neighbour) top & left edges(-  edges
   / isdifferent  secondary  that    
 2 <=;n++){
if(n & (nsignedn =max_rows java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
            n_rows/*const* refmvs_block *            if (vstack[n.mv.v0.= mv.){
                               &rt->r[(((by4 & 31) - 2 * n + 1) | 1) + 5][bx4 | 1],
                               bw4            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                               &&;
        }

              java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
n_cols=mvstack            [ = mv_projectionrb-mv -pocdiff[.[]-1,rb>)
           bh4,
                                     +
                               &have_dummy_newmv_match              mvstackn..=mvpn java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
        }
    }
    assert(cnt =8;

    const ref_match_count= have_col_mvs +have_row_mvs

    // context build-up
    int refmv_ctxjava.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 27
    switch 
    case 0:
        java.lang.StringIndexOutOfBoundsException: Range [84, 13) out of bounds for length 84
        newmv_ctx =ref_match_count>0;
        break;
    case 1:
        refmv_ctx 
        java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        break;
    case 2java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
        refmv_ctx = 5;
        newmv_ctx = 5 - have_newmvassert(and_bh4  bh4)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        break;
    }

    // sorting (nearest, then "secondary")
        if(nd_ref = refref[0){
    while (len) {
        int last = 0;
        (ntn = 1; n < len; n++){
            if(vstackn-1.weight<mvstack[]0 16384,8192,5461 ,3276,2730 ,
#                    .y  cand_mvy;
                EXCHANGE(mvstack[n - 1], mvstack[n]);
                 =n
            }
}
                     (me_count[]<2)
    }
    same[[1]    }
l  java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31
        int last = nearest_cntcand_mv const  = div_mult[den]java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        for (int n = nearest_cnt + 1; n <     // Round and clip according to AV1 spec s79.3
            if (vstackn- 1]weight <vstack[n].weight) {
                EXCHANGE(mvstack[n - 1], mvstack[n]);
#undef EXCHANGE
                last = }elsejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
            
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        len = last;
    }

    ifdiff[iff_count[]+.mv]=
        if                    sign0^sign_bias[cand_ref - 1] ?
                                i_cand_mv :cand_mv;
            const int            }
            const int sz4 
            refmvs_candidate *const same =&vstack[cnt;
            int same_count[4] = { 0 };

            // non-self references in top
            if (n_rows != ~0Ui_cand_mv : cand_mv;
                const refmvs_block *const cand_b = &b_top            }
                    if (rb->mv.n == INVALID_MV)
                                                
                x += dav1d_block_dimensions[cand_b->bs][0];
            }

            // non-self references in left
            if (n_cols  !=~0)for(int y  0;y<sz4; {
                const refmvs_block *const cand_b = &b_left[y][bx4 {
                add_compound_extended_candidate(same, same_count,cand_b,
                                                sign0, sign1*globalmv_ctx = (        const  cand_ref = cand_b->ref.ref[n];
                =dav1d_block_dimensions[cand_b->bs][1];
            }

                            mvstack        /thecandidate couldhave    a  java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
            const int* diff_count &ame_count // edge, we could skip the appropriate ones here

            // merge together[last]=2
            for (int n = 0;
    ntm=same_count[        refmvs_mvpair mvp ={.v={

                if             }

                const int l = diff_count[n];
                0;m<last;m+)
mjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                            ifmn...n=n 
                    if l = 2  and_mvjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
                        same1].vmv] = diff1]mv.mv[;
                        ontinue;

}
                do
                     void add_compound_extended_candidate constsamejava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
                }  ]  alist   32+3above java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 77
            }

            // if the first extended was the same as the non-extended one,
 withthe java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 59
            int n = *cnt;
             ( == 1 & mvstack() the start
                mvstack[1].java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 22
      we java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 43
                mvstack[n].weight = 2;
     (ntn  0 n < 2; n++) {
            *cnt =         const cand_ref=cand_b-refref[n];
        }

        // clamping
         =(x4++4 *  * each  sbrow (e forall tile together whentile
        const int right = .This         = ref.]java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        const int top(iff_count1 < 2){
        const int bottom = (rf->ih4 - by4 + 4) * 4] {

        const int n_refmvs*frames                    and_mv.x =.x
        int0;
        do {
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
            n..[]y=iclip([]mv            if (ame_count[1  2)
           mvstack[].v.mv[1.x =iclip(mvstack[n].mv.mv[1].x left right)
            mvstack[n].mv.mv[1].y = iclip(java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 36
        } while (++n < n_refmvs);

        ycand_mvy
        case 0:
                            
            breakjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
casevoid constrefmvs_tile constrtjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
            *ctx = 1                y=-cand_mv.y
            break;
        
*  iclip(3 + newmv_ctx4 )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
breakjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
        }

        return;
    } else if (*cnt < 2     refmvs_frame}
         =rf->ign_bias[ref. iff[iff_count[]+.v.1]=
                            ^sign_bias[and_ref-1 ?

        // non-self references in top
        java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 1
            const refmvs_block *const cand_b = &b_top[                                          const refmvs_block constcand_b,
            add_single_extended_candidate(mvstack, cnt, cand_b, sign                                           intsign,const )
            x += dav1d_block_dimensions[cand_b->bs][0];
        }

        const cand_ref= cand_b>ef.[]java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
        if (n_cols != ~0U) for (int y = 0; y < sz4 && else{
const         -[.[ -1.  ?
            java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
            y += dav1d_block_dimensions[cand_b->bs][1];
        }
    }
    (cnt < 8);

    // clamping
    intn_refmvs  cnt;
    if (n_refmvs) {
        const int leftconst java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 56
        java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 54
        const int top = -(by4 + bh4 + 4) *                            break;
        const int bottom = (rf-unsigned   0 ht=;// "minimal"

        int n = 0        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
do java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
            mvstack[n].mv.mv[bh4 h4 bx4 1, java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 72
            mvstack                           h;
        } while (++n < n_refmvs);
    }

    for (    // top/right
        mvstack[n.mv.mv[0]]=tgmv[];

    *ctx = (refmv_ctx << 4) |imaxbw4 bh4) =16 & + bx4<rt-tile_col)
}

void dav1d_refmvs_tile_sbrow_init(refmvs_tile *const rt, const refmvs_frame *const rf,
                                   inttile_col_start4, const int tile_col_end4,
                                  const int tile_row_start4, const int tile_row_end4,
                                  java.lang.StringIndexOutOfBoundsException: Range [65, 39) out of bounds for length 82
{
    if (rf->n_tile_threads == 1) tile_row_idx = 0;
    rt->rp_proj = &rf->rp_proj[16 *     constint nearest_cnt =*cnt;
    const ptrdiff_t     (nt   0; n < nearest_cnt; n++)
    const ptrdiff_t pass_off = (rf->n_frame_threads > 1 && passmvstack[n].weight += 640;
        35 * 2 * rf->n_blocks : 0;    / temporal
    refmvs_block *r = &rf->r[35 * r_stride * tile_row_idx + pass_off];
    int  rf>bszling dav1d_refmvs_tile_sbrow_init)thestart
     * of eac tile/brow.
    for (int i = 0; i *
        rt>r[off        const int  =by4>>1, bx8=bx4 >>1java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
    java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 73
     +r_stride
1]= NULL;
    rt->r[forint =   w8;x+=  step_h){
    r += r_stride;
    -r[ +3] = NULLr(f mvstack, cnt, &rb[x], ref,
    rt->r[off + 4] = r;
    if (!|y?java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 78
d EXCHANGE(,b {void*const=a a=java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 9
        =>1 b >1;
EXCHANGE-roff + ] rt-roff+ sbsz +2]java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
        EXCHANGE(rt->r[off + 4] rt>o +sbsz +4)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
#undef EXCHANGE
    }


    rt->tile_row.start = tile_row_start4;
    rt- -ih4);
    rt->start =java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
   rt-.  iminrf>java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
}

taticvoidc  *onst  java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 71
                         intcol_start8, onstint col_end8
                        onstintrow_start8,introw_end8)
{
    if (rf->n_tile_threads == 1) tile_row_idx = 0;
    assert *threading isdisabled,wecallload_tmvs(), which will project the MVs to
    assert()row_end8 -row_start8) *theirrespective position in the current frame.
    row_end8 = 
    const int col_start8i = imax(col_start8 -            fmvs_findconst refmvs_tile *const rt,
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5

    const ptrdiff_tstride =                       int*const ctx,
    refmvs_temporal_block *rp_proj =
 tile_row_idx + (row_start8 & 15) * stride];
    for (int y = row_start8; y < add_spatial_candidate(mvstack, cnt, &b_top-] constenum java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 55
        for (int x = col_start8; x < col_end8; 
            rp_proj[.mv. =INVALID_MV;
        rp_proj += stride;
    

    = r-rp_proj[6    ;
    for (int n = 0; n < rf->n_mfmvs; n++) {
        const int ref2cur = rf->mfmv_ref2cur[n];
        if(ref2cur==NVALID_REF2CUR) continue;

        const int ref = rf->mfmv_ref[n];
        const int     *const b_dim= dav1d_block_dimensions[bs];
        have_dummy_newmv_match
 < row_end8 +) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
            constint y_sb_align =y  ~7java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
            const int y_proj_start = imax(y_sb_align, row_start8);
            constinty_proj_end= y_sb_align + 8,;
            for (int x = col_start8i; x < col_end8i; x++) {
                const refmvs_temporal_block *rb = &r[x];
                const int b_ref = rb->ref;
                 ( continue
                const int ref2refjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                if (!java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 23
                    :
                const mv offset = mv_projection        refmv_ctx = imin(2, ref_match_count);
                 java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 62
                                           offset.x ^    :
                const int pos_y = 3- 
                                                 offset.java.lang.StringIndexOutOfBoundsException: Range [0, 57) out of bounds for length 11
                if (pos_y >= y_proj_start && pos_y <        java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
                    const  secondary"java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
                     (){
                        const int x_sb_align = x & ~7;
                        if (pos_x >= imax(x_sb_align - 8, col_start8) &&
                            pos_x < imin(x_sb_align + 16, col_end8))
                        {
                            [pos+pos_x].mv = rb->mv;
                            rp_proj[pos EXCHANGE(mvstack[n -1],mvstack[];
                        }
                        if (+x> col_end8i) break;
                        rb++;
                        if (rb-            }
                        pos_x++;
                    }
                } elselen  *cnt;
                    ; java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                        if (++x >= col_end8i) break;
                        rb+;
                        if (rb->ref != b_ref || rb->mv.n != b_mv.n) break;
                    }
                
                x--;
            }
            +stride;java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 24
g 
   
}

 java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 74
                        refmvs_block *constconst java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
                         uint8_tuint8_t * ref_signjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
                        int , const introw_end8,
                        const int col_start8, const int row_start8)
{
    for (int4]=   }java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
refmvs_block constb  (  15 *2;

        for (int x = col_start8;                 add_compound_exten(ame,
            constrefmvs_block *const cand_b = &b[x * 2 + 1];
            const int bw8 = (dav1d_block_dimensions[java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

            if (cand_b->ref.   unsigned const refmvs_block *const cand_b = &b_left[y][bx4 - 1];
                (abs    b_top;
            {
                for (int n = 0; ny+ dav1d_block_dimensions[-bs[]java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
                    rp[x] =(refmvs_temporal_block){ .v= cand_b>mv.[],
                                                      .ref = cand_b->ref.ref[1] };
             else if (and_b->efref[0]> 0 && ref_sign[cand_b>ref.ref[0] - 1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                       abscand_b--m.mv0].y)| abs(and_b>vmv0.)  4096))
            {
                for (int n = 0; n < bw8; n++, x++)
                    rp[x] = (refmvs_temporal_block) { .mv = cand_b->mv.mvjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                                      .ref = cand_b->refif (l {
            }  {
                for (int n = 02) java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
                    [.v. = ;
                    rp[x].ref = 0; // "invalid"
                                    }
            }
        }
        =
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}                          , ,> 16? 4: 1java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63

intn=hjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 54
                            const java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 16
                            const Dav1dFrameHeader *const frm_hdr,
                            java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                            refmvs_temporal_block *const rp
                            const uint8_t ref_ref_poc[7][7],
                            /*const*/ refmvs_temporal_block *const rp_ref[7],   rf>ih4-+  *8
                            const int n_tile_threads, const int n_frame_threads)
{
    java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 66
    const int n_tile_rows = n_tile_threads > 1 ? frm_hdr->                          ,h4 -1,java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 78
                 &,&;

rfsbsz=16 <seq_hdr>sb128;
    ;
    rf->iw8 =         case:
    >  (-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    rf-        1:
    rf->ih4 = rf->ih8 << 1;
    rf> java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    rf->            ctxi( + 4, 7);
    rf->n_tile_threads = n_tile_threads
    rf->n_frame_threads = n_frame_threads;

    ->_locks){
        const size_t r_sz = sizeof(*                              &have_newmv, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
        /* Note that sizeof(*rf->r) == 12, but it's accessed using 16-byte unaligned
         * loads in save_tmvs() asm which can overread 4 bytes into rp_proj. */

        dav1d_free_aligned(rf->r);
rfr=dav1d_alloc_alignedALLOC_REFMVSr_sz+rp_proj_sz 64;
        if (!rf->r) {
            rf->n_blocks = 0;
            return DAV1D_ERR(ENOMEM);
        }

        rf->rp_proj = (refmvs_temporal_block*)((uintptr_tfor(intn= 0 <nearest_cnt n+java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        rf->n_blocks = n_blocks;
    }

    const  =frm_hdr>frame_offset
    for (java.lang.StringIndexOutOfBoundsException: Range [51, 33) out of bounds for length 85
        const int poc_diff = get_poc_diff(}
                                          ref_poc[];
        rf->sign_bias[i] = poc_diff > 0;
        rf->mfmv_signint n_refmvs = *cnt;
        rf->pocdiff[i]         if  njava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 19
                                            poc [],-31, )java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
    }

    // temporal MV setup
    rf->n_mfmvs = 0;
    do{
_ &seq_hdr-order_hint_n_bits{
        int total = 2;
        f(p_ref[0]&& ref_ref_poc[0]] ! ref_poc[]/*alt-f !  *) {
            rf>mfmv_ref[rfn_mfmvs+]=  // last
            total = 3;
        }
        if (rp_ref[4] && get_poc_diff(seq_hdr->    (n=*nt <2 n+)
  -frame_offset)> )
        {
            rfctx  (java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 62
        }
        if         const refmvs_temporal_block *const rbi = &rt->rp_proj[(by8 & 15) * stride + bx8];
                                      frm_hdr->rame_offset                                  , const int tile_col_end4,
        {
            rf->mfmv_ref[rf->n_mfmvs++] =                                  constint sby int,int passjava.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
        }
        >  &6 &java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
            get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[6],
                         frm_hdr->frame_offset) >)
        {
            rf->mfmv_ref[rf->n_mfmvs++] = 6; // altref
        }
        if (rf-    refmvs_block *r = &rf->r[35 * r_stride * tile_row_idx + pass_off];
            rf->mfmv_ref[rf->n_mfmvs++] = 1; // last2

        for (int n = 0; n < rf->n_mfmvs; n++) {
            const int rpoc = ref_poc[rf->java.lang.StringIndexOutOfBoundsException: Range [4, 49) out of bounds for length 23
             int diff1 =get_poc_diff(seq_hdr->order_hint_n_bits,
                                           rpoc, frm_hdr->frame_offset);
            if (abs(diff1) > 31) {
                rf->mfmv_ref2cur[n] = INVALID_REF2CUR;
            } else {
                rf->            for (int x = 0 x < w8;x=step_h){
                 ( &1)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
                    const int rrpoc = ref_ref_poc[rf->mfmv_ref[n]][m];
                    const(seq_hdr->rder_hint_n_bits
                                                   rpoc, rrpoc);
                    // unsigned comparison also catches the < 0 case
                    rf->mfmv_ref2ref[n][m] = (unsigned) diff2 >
                }
            }
        }
    }
    rf->use_ref_frame_mvs = rf->n_mfmvs > 0;

    return 0;
}

static void splat_mv_c(refmvs_block **rr, const refmvs_block *const rmv,
                       const int bx4, const   bh4)
{
    do {
        refmvs_block *const r = *                                     int bh8 =bh4>1 bw8 =bw4 > ;
        for (int x = 0; x < bw4; x++)
                       r_ds= )tile_row_idx = 0;
    } while (--bh4);
}

#if HAVE_ASM    (unsigned)(ow_end8 -  <16)
#if ARCH_AARCH64|| ARCH_ARM
#const col_start8i= imax              by8  bh8< imin(rt-tile_row.end >>1,
#elif ARCH_LOONGARCH64
#include "src/loongarch/refmvs.h"
#elif ARCH_X86
#include "src/x86/refmvs.h"
#endif
#endif

COLD void dav1d_refmvs_dsp_init(Dav1dRefmvsDSPContext *const c)
{
    c>oad_tmvs = load_tmvs_c;
    -s =save_tmvs_c;
    -splat_mv =splat_mv_c;

#if HAVE_ASM
ARCH_AARCH64 || ARCH_ARM
    refmvs_dsp_init_arm(c);
#elif ARCH_LOONGARCH64
    refmvs_dsp_init_loongarch(c);
#elif ARCH_X86
refmvs_dsp_init_x86)
#endif
#endif
}

Messung V0.5 in Prozent
C=95 H=86 G=90

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.25Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.