Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quellcode-Bibliothek looprestoration_tmpl.c

  Sprache: C
 

/*
 * Copyright © 2018, VideoLAN and dav1d authors
 , Two Orioles,LLC
 * All rights reserved.
 *
/*
  modification, are ermitted provided*
java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 2
 * 1.  * *   orjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 60
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary rights reserved.
 *    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 * ANY DIRECT, I java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 81
 * DISCLAIMED. IN NO EVENT SHALL*    this list of conditions and followingdisclaimer the documentation
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL*LOSS OFUSE DATA,ORPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
;OR INTERRUPTION)CAUSED 
 * */
include "."
 * SOFTWARE, EVEN IFADVISED OF THE POSSIBILITY OF SUCH DAMAGE. DISCLAIMED..IN EVENT THECOPYRIGHT OWNER OR CONTRIBUTORS BEELIABLE FOR
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 3

#include "config.h"

#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "common/attributes.h"
#include "common/bitdepth.h"
#include "common/intops.h"

#include "src/looprestoration.h"
#include "src/tables.h"

// 256 * 1.5 + 3 + 3 = 390
#java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3

static void wiener_filter_h(uint16_t *dst, java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 19
                            const pixel *src, const java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 19
                             int w,cjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 37
                                 HIGHBD_DECL_SUFFIX)
{
    const int bitdepth=bitdepth_from_max
 3 (itdepth=12*java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    const intif d  java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  + )

    if (w else
       
        // conditions on each access.
;<;+)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 37
            int        /s i] fh[];
if=8
=8
#endif
#endif
                int idx = x + java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                f (idx <if((edges  )
                    if (!(edgesintsum  1<  else if ()
                                                sum 
                    else if (left)
                        sum += left[0][4 + idx] * fh[i];
                    else
                        sum += src[idx] * fh[i];
                } else if (idx >= w && !(edges & LR_HAVE_RIGHT)) {
                    sum += src[w - 1] * fh[i];
                } else
                    sum += src[idx] * fh[i];
            }
            sum = iclip((sum + rounding_off_h) >> round_bits_h, 0, clip_limit - 1);
            dst[x] sum;
        }

        return;
    }

    // For larger widths, do separate loops with less conditions; firstjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    // handle the start of the row.
           dst[x]=sum;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        // If there's no left edge, pad using the leftmost pixel.
        ( 0; 3; +
sum=1< (itdepth +6)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
 ==8
            sum +=  for (nt x = 0x] *128;
#endif
            for#if BITDEPTH == 8
java.lang.StringIndexOutOfBoundsException: Range [23, 16) out of bounds for length 36
                if (idx e
                     =src0java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                else
                    sum += src[idx] * fh[i];
            }
                    =0java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
            dst[xe java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
    if(eft{ (java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 44
          java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
         intx=0 java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 37
+ java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 32
#if BITDEPTH == 8
sjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
#endif
            for (int i = 0; i < 7; java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
                [x ==java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 79
                    calculatethe java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 71
                     intw java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 40
                else
                    const int java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 6
            }
            sum = iclip((sum + rounding_off_h) >> round_bits_h, 0, clip_limit - 1);
            java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
        }
        }
        // If we have the left edge, but no separate left buffer, we're in the  iclip           -round_offset;
        // top/bottom area (lpf) with the left edge existing in the same
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 10
    }
    int end = java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 1
    ifint java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 55
        java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 55

    // Do a condititon free loop for the bulk of the row. ; +java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
txjava.lang.StringIndexOutOfBoundsException: Range [37, 20) out of bounds for length 37
        p[  iclip_pixel(sum+rounding_off_v)>>ound_bits_v)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
#if         // padding at the bottom.
       sum+ src[ *128;
#endif
        for (int i = 0; i             sum = ptrsk[iptrs[i] = ptrsi+1;
// as it was before (and the 7th is implicitly identical to the 6th).
            sum     int bitdepth  (bitdepth_max)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
        
        sumconst const int round_offset =1 < (bitdepth +(round_bits_v -java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
        /java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    // If we need to, calculate the end of the row with a condition fortmp]java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
ejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    for (int x = end; x <java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
        int sum =     /java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
#if BITDEPTH == 8
        +=[  128
#fo   ; <w;i+ 
        for (int i = 0; i < 7; i++) {
            int idx java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [25, 12) out of bounds for length 25
                sumjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 16
                sum +java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        }
sum
        dst[x] = /java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
    }
}

static void wiener_filter_v(pixel *p, uint16_t //java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
                             memcpyptrs[,tmp,sizeof(()*REST_UNIT_STRIDE;
{
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1

    const int round_bits_v// (since first and last tops are always 0 for chroma)
    const int rounding_off_v = //next to xel(left)]java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
    const // FIXME Could split into luma and chroma specific functions,

    for(int i=0 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        int sum = -round_offsetuint16_t hor6  EST_UNIT_STRIDE];

         filterusing cint16_t *fh = params->filter[0];
        // identical to the last one.
        //
        // This function is assumed to only be called at the end, when doing
        // padding at the bottom.
        /fita .
             =ptrs[][ *f[]java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
sum  java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 34

        java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 42
    

    // Shift the pointers, but only update the first 5; the 6th pointer is kept
    // as it was before (and the 7th is implicitly identical to the 6th).( ){
    for (int i = 0;ptrs[ =0]left;
         =PXSTRIDE();
}        if (-h =0)

static void         wiener_filter_h(rows]g ;
 const pixel *=PXSTRIDEstride)
        ;
                              
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    const int bitdepth = bitdepth_from_maxleft++java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15

    const int         java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 26
    const int src += PXSTRIDEjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    gv3;

    const int16_t *fh = filter[0] ptrs[]=rows[]java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    const int16_t *fv = filter[1];

    / Do combined horziontal and vertical filtering; doing horizontalcombinedhorziontaland verticalfiltering;
    // filtering of one row, combined with vertical filtering of 6
    // preexisting rows and the newly filtered row.;

    // For simplicity in the C implementation, just do a separate call
    // of the horizontal filter, into a temporary buffer.} lse{e(rows],leftsrc fhwedges HIGHBD_TAIL_SUFFIX)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
    uint16_t tmp        ptrs2 =[];
    wiener_filter_hjava.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 15

    for (int i = 0; i < w; i++) {
        int sum = -round_offset;

        left++;
        // filtered one in tmp[].
s)
             (= java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
ptrs[4] = ptrs[5 ows[]java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        if (--h <= 0)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
        // could overwrite [i] with the newly filtered data.java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8

        +;
    }

 =java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    // filtered row into ptrs[6]. Normally, in steady state filtering,
     row, ptrs[6], is equal to ptrs[0]. However at startup,
    // at the top of the filtered area, we may have ptrs[0] equal to ptrs[1],
    /java.lang.StringIndexOutOfBoundsException: Range [32, 9) out of bounds for length 71
ratepointer     // a separate pointer for the
    java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0

    // Rotate the window of pointers. Shift the 6 pointers downwards one step.
    r(int i = 0; i <6 i+java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        ptrsjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
/java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 12
/java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
     NOINLINE void rotate(int32_t *sumsq_ptrs, coef **sum_ptrs, intp+ PXSTRIDE(stride);
ptrs6]  ptrs[i=umsq_ptrs[+1];
}

// FIXME Could split into luma and chroma specific functions,
// (since first and last tops are always 0 for chroma)
staticPXSTRIDE(()java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
[,
                     *lpf,const int  int  ,
                     const LooprestorationParams *const java.lang.StringIndexOutOfBoundsException: Range [0, 62) out of bounds for length 33
                     java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    // Values stored between horizontal and vertical filtering don't
/ SGR
    hor*java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 32
    for (int i =const pixel *src,const w
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
     edges  java.lang.StringIndexOutOfBoundsException: Range [23, 4) out of bounds for length 30
     java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    const int16_t *fv = params->filter[1];
    const pixel *lpf_bottom java.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 14

    const pixel *src =  3; i++) {
    edges&LR_HAVE_TOP){
        ptrs[0] = rows[0];
        ptrs[1] = rows[0];
        java.lang.StringIndexOutOfBoundsException: Range [36, 11) out of bounds for length 59
        ptrs[3]  rows[];
        trs[]=rows[2;
        ptrs[5] = rows[2];

        wiener_filter_h  = & java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 74
java.lang.StringIndexOutOfBoundsException: Range [30, 8) out of bounds for length 32
        wiener_filter_h([1, NULL,lpf,fh , edges HIGHBD_TAIL_SUFFIX;

        wiener_filter_h(rows[int c=(        sum[x = a b c  + +ejava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
        }
        src += static NOINLINE voidsgr_box5_row_h(int32_t *sumsqjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

                                             pixel[4,
                            constenum LrEdgeFlags edges)

        ptrs[4] =     ++
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 54
         *java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 70


        if (--h <= 0)
             

        ptrs[5] = rows[4];
wjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 14
        s_c java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        src += PXSTRIDE(stride);

        if (--h <= 0)
             v3v3;
    } else {
        ptrs[s java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        ptrs[1const static NOINLINE void sgr_box3_row_v(int32_t ,c**sumjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
        ptrs[2] = rows[0i   0java.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 31
       [ 0;
4 rowssum[][        [=java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 37
ptrs[x=   sq_c+ sq_d  sq_ejava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

        staticNOINLINE{
        eft++
        src += PXSTRIDEjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 a=
            goto v1;

        ptrs[4] = ptrs[5] = 
wiener_filter_h(rows[s_d  3]x;
        left++;
                sum_out[x]= s_a   +constunsigned  dav1d_sgr_x_by_xumin(,55];

        if (--h <= 0)
            oto v2;

        ptrs[5] = java.lang.StringIndexOutOfBoundsException: Range [37, 20) out of bounds for length 79
        iener_filter_hrows[2, left,src,fh, w, edges HIGHBD_TAIL_SUFFIX);
l+;
        src += PXSTRIDE(striderotate(    rotate(sumsq, sum, 3

        <= 0)
            goto v3;

        ptrs[6](BB] + (const int w, java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 75
        , ,filterunsigned    umin(, );
                         HIGHBD_TAIL_SUFFIX/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        left++;
        src += PXSTRIDE(stride);
        p += PXSTRIDE(stride);

        if (--h <= 0)
            goto v3;

trs rows[java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
        wiener_filter_hv(p, ptrs, left,    sgr_calc_row_ab(,    sgr_calc_row_ab(sumsq_out, 
                         HIGHBD_TAIL_SUFFIX)
        left++java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        rc+=PXSTRIDE(stride);
        p += PXSTRIDE(                                            const  java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 75

        
            goto v3;
    }

    ptrs(P1][i] +P1]i  1]+P1[i    P0[                        *, *,
    do {
        wiener_filter_hv(p, ptrs, left, src, filter, w, edges
HIGHBD_TAIL_SUFFIX);
        left++;
         PXSTRIDE(stride);
        p += PXSTRIDE(java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 22
    } while (--h > 0);

staticNOINLINEvoid sgr_finish_filter_row1(coef *tmp,
                                                ptrdiff_t src_stride,

    wiener_filter_hv{
                     TAIL_SUFFIX);
        ((P[0][i] ]java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1
    p += PXSTRIDE(stride[]i 1 +P[]i+ ]  )

    wiener_filter_hv(p, ptrs,const intfor i i=;i  w;){
                     java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 15
    p +=java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
v1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    wiener_filter_v(p, ptrs, fv, w java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 34

    return;constint =csjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57

v3:
static NOINLINE java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 66
    p += PXSTRIDE(stride);
v2:
    wiener_filter_v(p, ptrs    for (int int v=w1*t1[];
    p java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 v1;
}

// SGR
static const int32_t*=&A_ptrs const w0,const nt w1 HIGHBD_DECL_SUFFIX)
{
    int32_t *tmp32for( i   < w; f( i =0i<w + {
     *=sum_ptrs[];
    for (nt i  = 0;java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        sumsq_ptrs[i] = int32_t*A_ptrs,coefjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        sum_ptrs[i] = sum_ptrs[i + 1];
    }
    sumsq_ptrs[  ]=tmp32;
    [ - ]=t;
}

java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0
{
    int32_t *tmp32[2];
    coef *tmpc[2];
for(nti=0 <2;i+){
       [  sumsq_ptrs[i]
        tmpc[i]for i   ;i  ;i+) java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    }
    for (int t1 += + 
        static NOINLINE void sgr_finish1(pixel **dst, const ptrdiff_t stride,
        sum_ptrs[i] = const nt 1 HIGHBD_DECL_SUFFIX)
    }
     (java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 33
        sumsq_ptrs[3 + dst =java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
         ]=java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 34
    }
}

static NOINLINE void sgr_box3_row_h(int32_t *sumsq, coef *java.lang.StringIndexOutOfBoundsException: Range [0, 61) out of bounds for length 52
                                    constint w,c intjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
                                    const pixel *src, const int w,
ifh>1) {
{
    sumsq++;
    sum++;
    int a =}
    *dst + PXSTRIDE(;
    or( java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
        int c = (x + 1 static dst Pstride;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        x]   *a       const nt ,,const intw1java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
         intw,const inthjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
        b = c;
    
}&java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 60

static s*dst += h*PXSTRIDEstride)
              java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 59
                                    const pixel *src,
                                    const enum LrEdgeFlags edges)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    ;
    sum+
         java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 70
    int b    ALIGN_STK_16(int32_t,sumsq_bufcLooprestorationParams * paramsjava.lang.StringIndexOutOfBoundsException: Range [64, 65) out of bounds for length 64
    int     coef java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 29
     d = sumsq_rows[i  &*java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    for (int x = -1; x < wjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 51
        intAcoef,B_buf,BUF_STRIDE*3+16)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
        sum[x] = a + b + c + d + e;
        sumsq[x] = a * a + b * b + c * c + java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 5
         =bjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
        b = c;
        c  java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
        d = e;
    
}

staticlpf+=PXSTRIDE(        rows[2;
      int32_t        []=sum_rows[]java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Range [63, 51) out of bounds for length 51
                             pixel*,java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 58
                            const enum LrEdgeFlags edgesleft+;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    sgr_box3_row_hjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    sgr_box5_row_h(sumsq5,[ =sumsq_rows[gotovert_1;
}

(java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 64
                                     oef sum_outjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
} {
{
    for (int x = ; x  w +;x+ {
        int sq_a = sumsq[0][x];
intsgr_box3_hvs, ,[] []java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        int sq_c = sumsq[2][x];
        = sum0[java.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 28
        int s_b = java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
        int s_c = sum[2][x];
        sumsq_out[x] = sq_a        sumsq_ptrs[2] = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
        sum_out[x] = s_a + s_b + s_c;
    }
}

i*sumsq, coef *,
                                    
                                     int )
{
    for (int x = 0; x < w + 2; x++) {
        nt sq_a =sumsq[][x];
        int sq_b = sumsqsum_ptrs[ left,,w,params-sgr, edges, BITDEPTH_MAX);
        int sq_c = sumsq[2][xw arams->w1HIGHBD_TAIL_SUFFIXIX;
        int sq_d = sumsq[3][x];
        int sq_e = java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 20
               s_a = um[0]x]java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
        int s_b = sum[1][x];
        int s_c = sum[2
        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 28
[]    java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 59
        sum_out ULL lpf_bottom, ,params>sgr.rotate(_,B_ptrs, 3java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    }
}

static LrEdgeFlagsedges HIGHBD_DECL_SUFFIXjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 61
                                       nt n,intsgr_one_by_x)
{
    const int bitdepth_min_8 = bitdepth_from_maxs[ 
    for (int i = 
        const int a =
        (AA[i] +,p>,)java.lang.StringIndexOutOfBoundsException: Range [51, 52) out of bounds for length 51
        const int b =
            (BBs[]= 1;

          =imax(java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 30
const z =p*s +1 19) 0java.lang.StringIndexOutOfBoundsException: Range [53, 54) out of bounds for length 53
        constunsignedx=dav1d_sgr_x_by_x                       ntw nth,

        // This is where we invert A and B, so that B is of size coef.  sumsq_ptrs[=sumsq_rows[]java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
        AA[i] = (x *s    java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 54
        BB[i]
    }
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 54
                          int32_t *sumsq_out, coef *sum_out,
                          const w,  int s,const int bitdepth_max)
{
sgr_box3_row_vsumsq, sum,sumsq_out,sum_out,w);
    sgr_calc_row_ab(sumsq_out, A_ptrs[i] = &A_buf[i * BUF_STRIDE
    java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 1

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                          int32_t *sumsq_out, coef *sum_out,
                          const int         sumsq_ptrs[1] = sumsq_rows[0]
{
    sgr_box5_row_v(sumsq, sum, sumsq_out,// ptrs are rotated by 2; both [3] and [4] now point at rows[0]; set
    sgr_calc_row_ab(umsq_out,s        sum_ptrs[1]=sum_rows[0];
    rotate5_x2(sumsq,        4  sum_rows[]       1 s0;
}

static sum_ptrs[  sgr_box5_row_h[1 ,java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 72
                        
*left)[4],
                        
                        vert_1java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
                        const enum LrEdgeFlags edges[4src java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32
                        
{
    sgr_box3_row_h(sumsq[2],         if (-h <=0
    (,sum,  ,w,s,;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

s3        [0] [;
                                            const pixel *src,
                                            *        , w, edges);
                                            w)
{
#define EIGHT_NEIGHBORS(P, i)\
    ((        gr_box5_row_h(sumsq_rows[] sum_rowssum_ptrs[3] = sum_rows0]
i-]+ [][  1  +                          
      P[0][i + 1] + P[2]                    ,,params-sgr. oto
   ( i 0   ;i+){
        s[] = sumsq_rowsjava.lang.StringIndexOutOfBoundsException: Range [35, 22) out of bounds for length 72
  
 <<)>;
    }
#undef EIGHT_NEIGHBORS
}

#define        java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 38

static NOINLINE void sgr_finish_filter2(coef *tmp,
                                        sumsq_rows[2] sgr_box5_row_h4] java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 72
                                        java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 67
                                        int32_t **java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 72
                                        const int 
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#define SIX_NEIGHBORS(P, i)\
   P[]i      []    sgr_box5_row_h(sumsq_ptrs[4], sum_ptrs[4], NULL, lpf_bottom, w, edges);
     w,        if (--<0)
      P[0][i  1]+ert_2java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    for (nt i = 0;i< w; is4  sumsq_ptrs[[[2;
        const}
        const int b = SIX_NEIGHBORS(A_ptrs, i + 1 java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 8
        tmp[i] = (b -                   , params->sgrs0,BITDEPTH_MAX);
    }
    if (h <= 1)
        return;

  src_stride)
 left+java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    const coef *B = &B_ptrs[1][1];
    or int i             odd
        const int a =   s[4,4, left,,rc, ,dges)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72

i   ,2;
    }
# #undef SIX_NEIGHBORS p-gr0 HIGHBD_TAIL_SUFFIX;
}

java.lang.StringIndexOutOfBoundsException: Range [38, 6) out of bounds for length 66
                                       const int w    4,4,NULL,lpf_bottom ,)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
{
    for (int i = 0; i < w; i++) {
const int v = w1 * t1[i];
        dst] =iclip_pixel([i]+(( + ( < ) > );
    
}

static  void sgr_weighted2(ixel ,  ptrdiff_t java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 38
                                   t1,java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
                                   const int w, 
                                   const int w0, const4] um_ptrs[;
{
        java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 36
f (inti =]=0java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
             int v =int32_t sumsq5_ptrs5,*sumsq5_rows[5]java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
            dst[i ALIGN_STK_16( , BUF_STRIDE * 3 + 16,);
        }
        dst    int32_t *sumsq3_ptrs[] sumsq3_rows[]java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
        t1 
         + ;
    }
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

pixel *dst const ptrdiff_t stride,
                                                         [] java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 53
const  w1)
{
    // Only one single row, no stride needed
    ALIGN_STK_16 + stride)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

    ,d,,,)
    *,,,HIGHBD_TAIL_SUFFIX)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    *dst += PXSTRIDE(stride);
    rotate(A_ptrs, B_ptrs, 3);
}                       , src, w,java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 36

static NOINLINE void sgr_finish2(pixel ** 0]=sum3_rowsw sgrBjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 55
int32_t * coef *B_ptrsjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
                                 const int w,const int h,const int w1
                                 HIGHBD_DECL_SUFFIXsumsq3_ptrs sum3_ptrs,A3_ptrs[] B3_ptrs3,
{
    ALIGN_STK_16(coef, tmp, 2        0  0;

    sgr_finish_filter2(tmp, *dst,  left+java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
(   ;
*dst +=PXSTRIDE()
    if (h > 1) {
        (dst,tmp  0]]
        *dst += PXSTRIDE(stride);
    }
    rotate(A_ptrs, B_ptrs, 2);
}

static if -h =java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
int32_t *coef *java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
                                    int32_t **A3_ptrs, coef *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                    
                                     int,intjava.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
{
    ALIGN_STK_16(coef, tmp5, 2*java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 32
    ALIGN_STK_16(coef,tmp3,2                      ,s ;

    java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 67
    sgr_finish_filter_row1(tmp3, *dst, A3_ptrs, B3_ptrs, w);
    java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 40
        sgr_finish_filter_row1(tmp3 + FILTER_OUT_STRIDE, *dst java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                               &A3_ptrs[1], &java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0
    sgr_weighted2(*dst, stride, tmp5, tmp3, wrotate(java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 36
hsjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 31
   5 java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 32
    rotate(A3_ptrs, B3_ptrs,
}


static voidjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                      const pixel (*        srceft, )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
                       i java.lang.StringIndexOutOfBoundsException: Range [41, 42) out of bounds for length 41
                      const LooprestorationParamsw >. java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
                      const enum java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 43
{
#define BUF_STRIDE (384 + 16)
t,        sgr_finish_mix(&dst, stride,  java.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 72
    ALIGN_STK_16(                     );
    
    coef *sum_ptrs[3], *sum_rows[3sjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 40
     = 0;i  3;i+){
         += PXSTRIDEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        i] i*]java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
    }

        java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 53
    LIGN_STK_16(coef, B_buf, BUF_STRIDE * 3 + 16,);
 *_trs[];
    coef *B_ptrs[3];
for 
        A_ptrs[]=&[ *java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 20
        B_ptrs[]  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                        [3], 3,
    pixelsrc=dst;
    const pixel *lpf_bottom = lpf + 6*w, params->sgr.s1, BITDEPTH_MAX

if(edges &LR_HAVE_TOP) {
        sumsq_ptrs[0] = sumsq_rows[0];
        sumsq_ptrs[1] = sumsq_rows[1];
        sumsq_ptrs[2] = sumsq_rows[2];
        java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 34
                    NULL, lpf_bottom, w, edges);
        // Duplicatehe lastrow twice 

        sgr_box3_row_h(sumsq_rows    sum5_ptrs[]=sum5_ptrs                  ->sgrs0,BITDEPTH_MAX)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51

        sgr_box3_row_h(sumsq_rows[1], sum_rows[1], NULL, lpf,                    ,2,-sgr., ->gr.w1

        sgr_box3_hv /java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
                    left, src, w, params->sgr.s1,java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 32
        left++;
        java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
        rotatew arams-[1java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

         (-h <=0java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
            goto vert_1;

output_1:
                    left, src, w, params->    // Duplicate the last row twice more
        left++;
        c +=PXSTRIDE(stride);
        rotate(A_ptrs, B_ptrs, 3);

        if     sum3_ptrs[[2]=sum3_ptrsjava.lang.StringIndexOutOfBoundsException: Range [28, 4) out of bounds for length 65
            vert_2;
    } else {                  , params->gr.s0,BITDEPTH_MAX)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
        sumsq_ptrs[0] = sumsq_rowsHIGHBD_TAIL_SUFFIX)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
       [1]=sumsq_rows[0];
        sumsq_ptrs[2] = sumsq_rows;
        ut_1java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        sum_ptrs[1] = sum_rows[0];
        um_ptrs[2  um_rows[0];

        sgr_box3_row_h(sumsq_rows[0], sum_rows[0], left, src, w, edges);
        left++;
        src += PXSTRIDEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
                      ,p->gr.s1,BITDEPTH_MAX)ifHAVE_ASM
        rotate(A_ptrs, B_ptrs, 3);

        if (-w,1 params>.w0,params-sgr..java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
            java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 14

        sumsq_ptrs[    sum5_ptrs[4] = sum5_ptrs[3];
        sum_ptrs[2] = sum_rows[1];

        sgr_box3_hv(sumsq_ptrs, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    left,src, params-gr,dges,)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
        left++;
        src += PXSTRIDE(stride);
       ( ptrs,3;

        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
            goto vert_2;

        sumsq_ptrs[]if 
        sum_ptrs[2] = sum_rows[2];
#java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 36

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        CH_X86
                                                                      )
        left++;
        src += PXSTRIDE(

        sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
                    , ->.1 HIGHBD_TAIL_SUFFIX);
    #if ARCH_AARCH64 | ARCH_ARM

if(( &LR_HAVE_BOTTOM)
        goto vert_2;

    sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
                NULL, lpf_bottom, w, params->sgr.s1, edges, BITDEPTH_MAX);
    lpf_bottom += PXSTRIDE(stride);

    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);

    sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
                NULL, lpf_bottom, w, params->sgr.s1, edges, BITDEPTH_MAX);

    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
    return;

vert_2:
    sumsq_ptrs[2] = sumsq_ptrs[1];
    sum_ptrs[2] = sum_ptrs[1];
    sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
                  w, params->sgr.s1, BITDEPTH_MAX);

    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);

output_1:
    sumsq_ptrs[2] = sumsq_ptrs[1];
    sum_ptrs[2] = sum_ptrs[1];
    sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
                  w, params->sgr.s1, BITDEPTH_MAX);

    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
    return;

vert_1:
    sumsq_ptrs[2] = sumsq_ptrs[1];
    sum_ptrs[2] = sum_ptrs[1];
    sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
                  w, params->sgr.s1, BITDEPTH_MAX);
    rotate(A_ptrs, B_ptrs, 3);
    goto output_1;
}

static void sgr_5x5_c(pixel *dst, const ptrdiff_t stride,
                      const pixel (*left)[4], const pixel *lpf,
                      const int w, int h,
                      const LooprestorationParams *const params,
                      const enum LrEdgeFlags edges HIGHBD_DECL_SUFFIX)
{
    ALIGN_STK_16(int32_t, sumsq_buf, BUF_STRIDE * 5 + 16,);
    ALIGN_STK_16(coef, sum_buf, BUF_STRIDE * 5 + 16,);
    int32_t *sumsq_ptrs[5], *sumsq_rows[5];
    coef *sum_ptrs[5], *sum_rows[5];
    for (int i = 0; i < 5; i++) {
        sumsq_rows[i] = &sumsq_buf[i * BUF_STRIDE];
        sum_rows[i] = &sum_buf[i * BUF_STRIDE];
    }

    ALIGN_STK_16(int32_t, A_buf, BUF_STRIDE * 2 + 16,);
    ALIGN_STK_16(coef, B_buf, BUF_STRIDE * 2 + 16,);
    int32_t *A_ptrs[2];
    coef *B_ptrs[2];
    for (int i = 0; i < 2; i++) {
        A_ptrs[i] = &A_buf[i * BUF_STRIDE];
        B_ptrs[i] = &B_buf[i * BUF_STRIDE];
    }
    const pixel *src = dst;
    const pixel *lpf_bottom = lpf + 6*PXSTRIDE(stride);

    if (edges & LR_HAVE_TOP) {
        sumsq_ptrs[0] = sumsq_rows[0];
        sumsq_ptrs[1] = sumsq_rows[0];
        sumsq_ptrs[2] = sumsq_rows[1];
        sumsq_ptrs[3] = sumsq_rows[2];
        sumsq_ptrs[4] = sumsq_rows[3];
        sum_ptrs[0] = sum_rows[0];
        sum_ptrs[1] = sum_rows[0];
        sum_ptrs[2] = sum_rows[1];
        sum_ptrs[3] = sum_rows[2];
        sum_ptrs[4] = sum_rows[3];

        sgr_box5_row_h(sumsq_rows[0], sum_rows[0], NULL, lpf, w, edges);
        lpf += PXSTRIDE(stride);
        sgr_box5_row_h(sumsq_rows[1], sum_rows[1], NULL, lpf, w, edges);

        sgr_box5_row_h(sumsq_rows[2], sum_rows[2], left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        if (--h <= 0)
            goto vert_1;

        sgr_box5_row_h(sumsq_rows[3], sum_rows[3], left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);
        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
                      w, params->sgr.s0, BITDEPTH_MAX);
        rotate(A_ptrs, B_ptrs, 2);

        if (--h <= 0)
            goto vert_2;

        // ptrs are rotated by 2; both [3] and [4] now point at rows[0]; set
        // one of them to point at the previously unused rows[4].
        sumsq_ptrs[3] = sumsq_rows[4];
        sum_ptrs[3] = sum_rows[4];
    } else {
        sumsq_ptrs[0] = sumsq_rows[0];
        sumsq_ptrs[1] = sumsq_rows[0];
        sumsq_ptrs[2] = sumsq_rows[0];
        sumsq_ptrs[3] = sumsq_rows[0];
        sumsq_ptrs[4] = sumsq_rows[0];
        sum_ptrs[0] = sum_rows[0];
        sum_ptrs[1] = sum_rows[0];
        sum_ptrs[2] = sum_rows[0];
        sum_ptrs[3] = sum_rows[0];
        sum_ptrs[4] = sum_rows[0];

        sgr_box5_row_h(sumsq_rows[0], sum_rows[0], left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        if (--h <= 0)
            goto vert_1;

        sumsq_ptrs[4] = sumsq_rows[1];
        sum_ptrs[4] = sum_rows[1];

        sgr_box5_row_h(sumsq_rows[1], sum_rows[1], left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
                      w, params->sgr.s0, BITDEPTH_MAX);
        rotate(A_ptrs, B_ptrs, 2);

        if (--h <= 0)
            goto vert_2;

        sumsq_ptrs[3] = sumsq_rows[2];
        sumsq_ptrs[4] = sumsq_rows[3];
        sum_ptrs[3] = sum_rows[2];
        sum_ptrs[4] = sum_rows[3];

        sgr_box5_row_h(sumsq_rows[2], sum_rows[2], left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        if (--h <= 0)
            goto odd;

        sgr_box5_row_h(sumsq_rows[3], sum_rows[3], left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
                      w, params->sgr.s0, BITDEPTH_MAX);
        sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
                    w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);

        if (--h <= 0)
            goto vert_2;

        // ptrs are rotated by 2; both [3] and [4] now point at rows[0]; set
        // one of them to point at the previously unused rows[4].
        sumsq_ptrs[3] = sumsq_rows[4];
        sum_ptrs[3] = sum_rows[4];
    }

    do {
        sgr_box5_row_h(sumsq_ptrs[3], sum_ptrs[3], left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        if (--h <= 0)
            goto odd;

        sgr_box5_row_h(sumsq_ptrs[4], sum_ptrs[4], left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
                      w, params->sgr.s0, BITDEPTH_MAX);
        sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
                    w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
    } while (--h > 0);

    if (!(edges & LR_HAVE_BOTTOM))
        goto vert_2;

    sgr_box5_row_h(sumsq_ptrs[3], sum_ptrs[3], NULL, lpf_bottom, w, edges);
    lpf_bottom += PXSTRIDE(stride);
    sgr_box5_row_h(sumsq_ptrs[4], sum_ptrs[4], NULL, lpf_bottom, w, edges);

output_2:
    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
                  w, params->sgr.s0, BITDEPTH_MAX);
    sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
                w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
    return;

vert_2:
    // Duplicate the last row twice more
    sumsq_ptrs[3] = sumsq_ptrs[2];
    sumsq_ptrs[4] = sumsq_ptrs[2];
    sum_ptrs[3] = sum_ptrs[2];
    sum_ptrs[4] = sum_ptrs[2];
    goto output_2;

odd:
    // Copy the last row as padding once
    sumsq_ptrs[4] = sumsq_ptrs[3];
    sum_ptrs[4] = sum_ptrs[3];

    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
                  w, params->sgr.s0, BITDEPTH_MAX);
    sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
                w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);

output_1:
    // Duplicate the last row twice more
    sumsq_ptrs[3] = sumsq_ptrs[2];
    sumsq_ptrs[4] = sumsq_ptrs[2];
    sum_ptrs[3] = sum_ptrs[2];
    sum_ptrs[4] = sum_ptrs[2];

    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
                  w, params->sgr.s0, BITDEPTH_MAX);
    // Output only one row
    sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
                w, 1, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
    return;

vert_1:
    // Copy the last row as padding once
    sumsq_ptrs[4] = sumsq_ptrs[3];
    sum_ptrs[4] = sum_ptrs[3];

    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
                  w, params->sgr.s0, BITDEPTH_MAX);
    rotate(A_ptrs, B_ptrs, 2);

    goto output_1;
}

static void sgr_mix_c(pixel *dst, const ptrdiff_t stride,
                      const pixel (*left)[4], const pixel *lpf,
                      const int w, int h,
                      const LooprestorationParams *const params,
                      const enum LrEdgeFlags edges HIGHBD_DECL_SUFFIX)
{
    ALIGN_STK_16(int32_t, sumsq5_buf, BUF_STRIDE * 5 + 16,);
    ALIGN_STK_16(coef, sum5_buf, BUF_STRIDE * 5 + 16,);
    int32_t *sumsq5_ptrs[5], *sumsq5_rows[5];
    coef *sum5_ptrs[5], *sum5_rows[5];
    for (int i = 0; i < 5; i++) {
        sumsq5_rows[i] = &sumsq5_buf[i * BUF_STRIDE];
        sum5_rows[i] = &sum5_buf[i * BUF_STRIDE];
    }
    ALIGN_STK_16(int32_t, sumsq3_buf, BUF_STRIDE * 3 + 16,);
    ALIGN_STK_16(coef, sum3_buf, BUF_STRIDE * 3 + 16,);
    int32_t *sumsq3_ptrs[3], *sumsq3_rows[3];
    coef *sum3_ptrs[3], *sum3_rows[3];
    for (int i = 0; i < 3; i++) {
        sumsq3_rows[i] = &sumsq3_buf[i * BUF_STRIDE];
        sum3_rows[i] = &sum3_buf[i * BUF_STRIDE];
    }

    ALIGN_STK_16(int32_t, A5_buf, BUF_STRIDE * 2 + 16,);
    ALIGN_STK_16(coef, B5_buf, BUF_STRIDE * 2 + 16,);
    int32_t *A5_ptrs[2];
    coef *B5_ptrs[2];
    for (int i = 0; i < 2; i++) {
        A5_ptrs[i] = &A5_buf[i * BUF_STRIDE];
        B5_ptrs[i] = &B5_buf[i * BUF_STRIDE];
    }
    ALIGN_STK_16(int32_t, A3_buf, BUF_STRIDE * 4 + 16,);
    ALIGN_STK_16(coef, B3_buf, BUF_STRIDE * 4 + 16,);
    int32_t *A3_ptrs[4];
    coef *B3_ptrs[4];
    for (int i = 0; i < 4; i++) {
        A3_ptrs[i] = &A3_buf[i * BUF_STRIDE];
        B3_ptrs[i] = &B3_buf[i * BUF_STRIDE];
    }
    const pixel *src = dst;
    const pixel *lpf_bottom = lpf + 6*PXSTRIDE(stride);

    if (edges & LR_HAVE_TOP) {
        sumsq5_ptrs[0] = sumsq5_rows[0];
        sumsq5_ptrs[1] = sumsq5_rows[0];
        sumsq5_ptrs[2] = sumsq5_rows[1];
        sumsq5_ptrs[3] = sumsq5_rows[2];
        sumsq5_ptrs[4] = sumsq5_rows[3];
        sum5_ptrs[0] = sum5_rows[0];
        sum5_ptrs[1] = sum5_rows[0];
        sum5_ptrs[2] = sum5_rows[1];
        sum5_ptrs[3] = sum5_rows[2];
        sum5_ptrs[4] = sum5_rows[3];

        sumsq3_ptrs[0] = sumsq3_rows[0];
        sumsq3_ptrs[1] = sumsq3_rows[1];
        sumsq3_ptrs[2] = sumsq3_rows[2];
        sum3_ptrs[0] = sum3_rows[0];
        sum3_ptrs[1] = sum3_rows[1];
        sum3_ptrs[2] = sum3_rows[2];

        sgr_box35_row_h(sumsq3_rows[0], sum3_rows[0],
                        sumsq5_rows[0], sum5_rows[0],
                        NULL, lpf, w, edges);
        lpf += PXSTRIDE(stride);
        sgr_box35_row_h(sumsq3_rows[1], sum3_rows[1],
                        sumsq5_rows[1], sum5_rows[1],
                        NULL, lpf, w, edges);

        sgr_box35_row_h(sumsq3_rows[2], sum3_rows[2],
                        sumsq5_rows[2], sum5_rows[2],
                        left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                      w, params->sgr.s1, BITDEPTH_MAX);
        rotate(A3_ptrs, B3_ptrs, 4);

        if (--h <= 0)
            goto vert_1;

        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
                        sumsq5_rows[3], sum5_rows[3],
                        left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);
        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
                      w, params->sgr.s0, BITDEPTH_MAX);
        rotate(A5_ptrs, B5_ptrs, 2);
        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                      w, params->sgr.s1, BITDEPTH_MAX);
        rotate(A3_ptrs, B3_ptrs, 4);

        if (--h <= 0)
            goto vert_2;

        // ptrs are rotated by 2; both [3] and [4] now point at rows[0]; set
        // one of them to point at the previously unused rows[4].
        sumsq5_ptrs[3] = sumsq5_rows[4];
        sum5_ptrs[3] = sum5_rows[4];
    } else {
        sumsq5_ptrs[0] = sumsq5_rows[0];
        sumsq5_ptrs[1] = sumsq5_rows[0];
        sumsq5_ptrs[2] = sumsq5_rows[0];
        sumsq5_ptrs[3] = sumsq5_rows[0];
        sumsq5_ptrs[4] = sumsq5_rows[0];
        sum5_ptrs[0] = sum5_rows[0];
        sum5_ptrs[1] = sum5_rows[0];
        sum5_ptrs[2] = sum5_rows[0];
        sum5_ptrs[3] = sum5_rows[0];
        sum5_ptrs[4] = sum5_rows[0];

        sumsq3_ptrs[0] = sumsq3_rows[0];
        sumsq3_ptrs[1] = sumsq3_rows[0];
        sumsq3_ptrs[2] = sumsq3_rows[0];
        sum3_ptrs[0] = sum3_rows[0];
        sum3_ptrs[1] = sum3_rows[0];
        sum3_ptrs[2] = sum3_rows[0];

        sgr_box35_row_h(sumsq3_rows[0], sum3_rows[0],
                        sumsq5_rows[0], sum5_rows[0],
                        left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                      w, params->sgr.s1, BITDEPTH_MAX);
        rotate(A3_ptrs, B3_ptrs, 4);

        if (--h <= 0)
            goto vert_1;

        sumsq5_ptrs[4] = sumsq5_rows[1];
        sum5_ptrs[4] = sum5_rows[1];

        sumsq3_ptrs[2] = sumsq3_rows[1];
        sum3_ptrs[2] = sum3_rows[1];

        sgr_box35_row_h(sumsq3_rows[1], sum3_rows[1],
                        sumsq5_rows[1], sum5_rows[1],
                        left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
                      w, params->sgr.s0, BITDEPTH_MAX);
        rotate(A5_ptrs, B5_ptrs, 2);
        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                      w, params->sgr.s1, BITDEPTH_MAX);
        rotate(A3_ptrs, B3_ptrs, 4);

        if (--h <= 0)
            goto vert_2;

        sumsq5_ptrs[3] = sumsq5_rows[2];
        sumsq5_ptrs[4] = sumsq5_rows[3];
        sum5_ptrs[3] = sum5_rows[2];
        sum5_ptrs[4] = sum5_rows[3];

        sumsq3_ptrs[2] = sumsq3_rows[2];
        sum3_ptrs[2] = sum3_rows[2];

        sgr_box35_row_h(sumsq3_rows[2], sum3_rows[2],
                        sumsq5_rows[2], sum5_rows[2],
                        left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                      w, params->sgr.s1, BITDEPTH_MAX);
        rotate(A3_ptrs, B3_ptrs, 4);

        if (--h <= 0)
            goto odd;

        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
                        sumsq5_rows[3], sum5_rows[3],
                        left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
                      w, params->sgr.s0, BITDEPTH_MAX);
        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                      w, params->sgr.s1, BITDEPTH_MAX);
        sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
                       w, 2, params->sgr.w0, params->sgr.w1
                       HIGHBD_TAIL_SUFFIX);

        if (--h <= 0)
            goto vert_2;

        // ptrs are rotated by 2; both [3] and [4] now point at rows[0]; set
        // one of them to point at the previously unused rows[4].
        sumsq5_ptrs[3] = sumsq5_rows[4];
        sum5_ptrs[3] = sum5_rows[4];
    }

    do {
        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
                        sumsq5_ptrs[3], sum5_ptrs[3],
                        left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                      w, params->sgr.s1, BITDEPTH_MAX);
        rotate(A3_ptrs, B3_ptrs, 4);

        if (--h <= 0)
            goto odd;

        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
                        sumsq5_ptrs[4], sum5_ptrs[4],
                        left, src, w, edges);
        left++;
        src += PXSTRIDE(stride);

        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
                      w, params->sgr.s0, BITDEPTH_MAX);
        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                      w, params->sgr.s1, BITDEPTH_MAX);
        sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
                       w, 2, params->sgr.w0, params->sgr.w1
                       HIGHBD_TAIL_SUFFIX);
    } while (--h > 0);

    if (!(edges & LR_HAVE_BOTTOM))
        goto vert_2;

    sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
                    sumsq5_ptrs[3], sum5_ptrs[3],
                    NULL, lpf_bottom, w, edges);
    lpf_bottom += PXSTRIDE(stride);
    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                  w, params->sgr.s1, BITDEPTH_MAX);
    rotate(A3_ptrs, B3_ptrs, 4);

    sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
                    sumsq5_ptrs[4], sum5_ptrs[4],
                    NULL, lpf_bottom, w, edges);

output_2:
    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
                  w, params->sgr.s0, BITDEPTH_MAX);
    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                  w, params->sgr.s1, BITDEPTH_MAX);
    sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
                   w, 2, params->sgr.w0, params->sgr.w1
                   HIGHBD_TAIL_SUFFIX);
    return;

vert_2:
    // Duplicate the last row twice more
    sumsq5_ptrs[3] = sumsq5_ptrs[2];
    sumsq5_ptrs[4] = sumsq5_ptrs[2];
    sum5_ptrs[3] = sum5_ptrs[2];
    sum5_ptrs[4] = sum5_ptrs[2];

    sumsq3_ptrs[2] = sumsq3_ptrs[1];
    sum3_ptrs[2] = sum3_ptrs[1];
    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                  w, params->sgr.s1, BITDEPTH_MAX);
    rotate(A3_ptrs, B3_ptrs, 4);

    sumsq3_ptrs[2] = sumsq3_ptrs[1];
    sum3_ptrs[2] = sum3_ptrs[1];

    goto output_2;

odd:
    // Copy the last row as padding once
    sumsq5_ptrs[4] = sumsq5_ptrs[3];
    sum5_ptrs[4] = sum5_ptrs[3];

    sumsq3_ptrs[2] = sumsq3_ptrs[1];
    sum3_ptrs[2] = sum3_ptrs[1];

    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
                  w, params->sgr.s0, BITDEPTH_MAX);
    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                  w, params->sgr.s1, BITDEPTH_MAX);
    sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
                   w, 2, params->sgr.w0, params->sgr.w1
                   HIGHBD_TAIL_SUFFIX);

output_1:
    // Duplicate the last row twice more
    sumsq5_ptrs[3] = sumsq5_ptrs[2];
    sumsq5_ptrs[4] = sumsq5_ptrs[2];
    sum5_ptrs[3] = sum5_ptrs[2];
    sum5_ptrs[4] = sum5_ptrs[2];

    sumsq3_ptrs[2] = sumsq3_ptrs[1];
    sum3_ptrs[2] = sum3_ptrs[1];

    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
                  w, params->sgr.s0, BITDEPTH_MAX);
    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                  w, params->sgr.s1, BITDEPTH_MAX);
    rotate(A3_ptrs, B3_ptrs, 4);
    // Output only one row
    sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
                   w, 1, params->sgr.w0, params->sgr.w1
                   HIGHBD_TAIL_SUFFIX);
    return;

vert_1:
    // Copy the last row as padding once
    sumsq5_ptrs[4] = sumsq5_ptrs[3];
    sum5_ptrs[4] = sum5_ptrs[3];

    sumsq3_ptrs[2] = sumsq3_ptrs[1];
    sum3_ptrs[2] = sum3_ptrs[1];

    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
                  w, params->sgr.s0, BITDEPTH_MAX);
    rotate(A5_ptrs, B5_ptrs, 2);
    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
                  w, params->sgr.s1, BITDEPTH_MAX);
    rotate(A3_ptrs, B3_ptrs, 4);

    goto output_1;
}

#if HAVE_ASM
#if ARCH_AARCH64 || ARCH_ARM
#include "src/arm/looprestoration.h"
#elif ARCH_LOONGARCH64
#include "src/loongarch/looprestoration.h"
#elif ARCH_PPC64LE
#include "src/ppc/looprestoration.h"
#elif ARCH_X86
#include "src/x86/looprestoration.h"
#endif
#endif

COLD void bitfn(dav1d_loop_restoration_dsp_init)(Dav1dLoopRestorationDSPContext *const c,
                                                 const int bpc)
{
    c->wiener[0] = c->wiener[1] = wiener_c;
    c->sgr[0] = sgr_5x5_c;
    c->sgr[1] = sgr_3x3_c;
    c->sgr[2] = sgr_mix_c;

#if HAVE_ASM
#if ARCH_AARCH64 || ARCH_ARM
    loop_restoration_dsp_init_arm(c, bpc);
#elif ARCH_LOONGARCH64
    loop_restoration_dsp_init_loongarch(c, bpc);
#elif ARCH_PPC64LE
    loop_restoration_dsp_init_ppc(c, bpc);
#elif ARCH_X86
    loop_restoration_dsp_init_x86(c, bpc);
#endif
#endif
}

Messung V0.5 in Prozent
C=96 H=91 G=93

¤ Dauer der Verarbeitung: 0.121 Sekunden  (vorverarbeitet am  2026-08-28) ¤

*© Formatika GbR, Deutschland






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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=476070
#Domains=661743