1233d2500723e5594f3e7c70896ffeeef32b9c950ywan/*
2233d2500723e5594f3e7c70896ffeeef32b9c950ywan *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3233d2500723e5594f3e7c70896ffeeef32b9c950ywan *
4233d2500723e5594f3e7c70896ffeeef32b9c950ywan *  Use of this source code is governed by a BSD-style license
5233d2500723e5594f3e7c70896ffeeef32b9c950ywan *  that can be found in the LICENSE file in the root of the source
6233d2500723e5594f3e7c70896ffeeef32b9c950ywan *  tree. An additional intellectual property rights grant can be found
7233d2500723e5594f3e7c70896ffeeef32b9c950ywan *  in the file PATENTS.  All contributing project authors may
8233d2500723e5594f3e7c70896ffeeef32b9c950ywan *  be found in the AUTHORS file in the root of the source tree.
9233d2500723e5594f3e7c70896ffeeef32b9c950ywan */
10233d2500723e5594f3e7c70896ffeeef32b9c950ywan
11233d2500723e5594f3e7c70896ffeeef32b9c950ywan
12233d2500723e5594f3e7c70896ffeeef32b9c950ywan#include "swapyv12buffer.h"
13233d2500723e5594f3e7c70896ffeeef32b9c950ywan
14233d2500723e5594f3e7c70896ffeeef32b9c950ywanvoid vp8_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame, YV12_BUFFER_CONFIG *last_frame)
15233d2500723e5594f3e7c70896ffeeef32b9c950ywan{
16233d2500723e5594f3e7c70896ffeeef32b9c950ywan    unsigned char *temp;
17233d2500723e5594f3e7c70896ffeeef32b9c950ywan
18233d2500723e5594f3e7c70896ffeeef32b9c950ywan    temp = last_frame->buffer_alloc;
19233d2500723e5594f3e7c70896ffeeef32b9c950ywan    last_frame->buffer_alloc = new_frame->buffer_alloc;
20233d2500723e5594f3e7c70896ffeeef32b9c950ywan    new_frame->buffer_alloc = temp;
21233d2500723e5594f3e7c70896ffeeef32b9c950ywan
22233d2500723e5594f3e7c70896ffeeef32b9c950ywan    temp = last_frame->y_buffer;
23233d2500723e5594f3e7c70896ffeeef32b9c950ywan    last_frame->y_buffer = new_frame->y_buffer;
24233d2500723e5594f3e7c70896ffeeef32b9c950ywan    new_frame->y_buffer = temp;
25233d2500723e5594f3e7c70896ffeeef32b9c950ywan
26233d2500723e5594f3e7c70896ffeeef32b9c950ywan    temp = last_frame->u_buffer;
27233d2500723e5594f3e7c70896ffeeef32b9c950ywan    last_frame->u_buffer = new_frame->u_buffer;
28233d2500723e5594f3e7c70896ffeeef32b9c950ywan    new_frame->u_buffer = temp;
29233d2500723e5594f3e7c70896ffeeef32b9c950ywan
30233d2500723e5594f3e7c70896ffeeef32b9c950ywan    temp = last_frame->v_buffer;
31233d2500723e5594f3e7c70896ffeeef32b9c950ywan    last_frame->v_buffer = new_frame->v_buffer;
32233d2500723e5594f3e7c70896ffeeef32b9c950ywan    new_frame->v_buffer = temp;
33233d2500723e5594f3e7c70896ffeeef32b9c950ywan
34233d2500723e5594f3e7c70896ffeeef32b9c950ywan}
35