vp9_swapyv12buffer.c 1.02 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
#include "vp9/common/vp9_swapyv12buffer.h"
John Koleszar's avatar
John Koleszar committed
12

13
14
void vp9_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame,
                          YV12_BUFFER_CONFIG *last_frame) {
John Koleszar's avatar
John Koleszar committed
15
  unsigned char *temp;
John Koleszar's avatar
John Koleszar committed
16

John Koleszar's avatar
John Koleszar committed
17
18
19
  temp = last_frame->buffer_alloc;
  last_frame->buffer_alloc = new_frame->buffer_alloc;
  new_frame->buffer_alloc = temp;
John Koleszar's avatar
John Koleszar committed
20

John Koleszar's avatar
John Koleszar committed
21
22
23
  temp = last_frame->y_buffer;
  last_frame->y_buffer = new_frame->y_buffer;
  new_frame->y_buffer = temp;
John Koleszar's avatar
John Koleszar committed
24

John Koleszar's avatar
John Koleszar committed
25
26
27
  temp = last_frame->u_buffer;
  last_frame->u_buffer = new_frame->u_buffer;
  new_frame->u_buffer = temp;
John Koleszar's avatar
John Koleszar committed
28

John Koleszar's avatar
John Koleszar committed
29
30
31
  temp = last_frame->v_buffer;
  last_frame->v_buffer = new_frame->v_buffer;
  new_frame->v_buffer = temp;
John Koleszar's avatar
John Koleszar committed
32
}