picklpf_arm.c 1.65 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5
6
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
7
 *  in the file PATENTS.  All contributing project authors may
8
 *  be found in the AUTHORS file in the root of the source tree.
John Koleszar's avatar
John Koleszar committed
9
10
 */

11
12
#include "vp8/common/loopfilter.h"
#include "vpx_scale/yv12config.h"
John Koleszar's avatar
John Koleszar committed
13

14
15
16
extern void vp8_memcpy_partial_neon(unsigned char *dst_ptr,
                                    unsigned char *src_ptr,
                                    int sz);
John Koleszar's avatar
John Koleszar committed
17
18


19
20
void vp8_yv12_copy_partial_frame_neon(YV12_BUFFER_CONFIG *src_ybc,
                                      YV12_BUFFER_CONFIG *dst_ybc)
John Koleszar's avatar
John Koleszar committed
21
22
23
24
25
26
27
28
29
30
{
    unsigned char *src_y, *dst_y;
    int yheight;
    int ystride;
    int yoffset;
    int linestocopy;

    yheight  = src_ybc->y_height;
    ystride  = src_ybc->y_stride;

31
32
33
34
35
36
37
38
39
40
41
    /* number of MB rows to use in partial filtering */
    linestocopy = (yheight >> 4) / PARTIAL_FRAME_FRACTION;
    linestocopy = linestocopy ? linestocopy << 4 : 16;     /* 16 lines per MB */

    /* Copy extra 4 so that full filter context is available if filtering done
     * on the copied partial frame and not original. Partial filter does mb
     * filtering for top row also, which can modify3 pixels above.
     */
    linestocopy += 4;
    /* partial image starts at ~middle of frame (macroblock border) */
    yoffset  = ystride * (((yheight >> 5) * 16) - 4);
John Koleszar's avatar
John Koleszar committed
42
43
44
    src_y = src_ybc->y_buffer + yoffset;
    dst_y = dst_ybc->y_buffer + yoffset;

45
    vp8_memcpy_partial_neon(dst_y, src_y, ystride * linestocopy);
John Koleszar's avatar
John Koleszar committed
46
}