mux: mp4: fix recording of rtsp
[vlc.git] / modules / video_chroma / copy.h
blob9b9dbd1f66ec3d5a5ac213e53dfb0021d1f0ab24
1 /*****************************************************************************
2 * copy.h: Fast YV12/NV12 copy
3 *****************************************************************************
4 * Copyright (C) 2009 Laurent Aimar
5 * $Id$
7 * Authors: Laurent Aimar <fenrir_AT_ videolan _DOT_ org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef VLC_VIDEOCHROMA_COPY_H_
25 #define VLC_VIDEOCHROMA_COPY_H_
27 typedef struct {
28 # ifdef CAN_COMPILE_SSE2
29 uint8_t *buffer;
30 size_t size;
31 # endif
32 } copy_cache_t;
34 int CopyInitCache(copy_cache_t *cache, unsigned width);
35 void CopyCleanCache(copy_cache_t *cache);
37 /* Copy planes from NV12 to YV12 */
38 void CopyFromNv12ToYv12(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
39 unsigned height, copy_cache_t *cache);
40 /* Copy planes from YV12 to YV12 */
41 void CopyFromYv12ToYv12(picture_t *dst, uint8_t *src[3], size_t src_pitch[3],
42 unsigned height, copy_cache_t *cache);
44 void CopyFromNv12ToNv12(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
45 unsigned height, copy_cache_t *cache);
47 void CopyFromNv12ToI420(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
48 unsigned height, copy_cache_t *cache);
50 void CopyFromI420ToNv12(picture_t *dst, uint8_t *src[3], size_t src_pitch[3],
51 unsigned height, copy_cache_t *cache);
53 void CopyFromI420_10ToP010(picture_t *dst, uint8_t *src[3], size_t src_pitch[3],
54 unsigned height, copy_cache_t *cache);
56 /**
57 * This functions sets the internal plane pointers/dimensions for the given
58 * buffer.
59 * This is useful when mapping opaque surfaces into CPU planes.
61 * picture is the picture to update
62 * data is the buffer pointer to use as the start of data for all the planes
63 * pitch is the internal line pitch for the buffer
65 int picture_UpdatePlanes(picture_t *picture, uint8_t *data, unsigned pitch);
67 #endif