1 /* 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * 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. 9 */ 10 #ifndef VPX_VP9_VP9_IFACE_COMMON_H_ 11 #define VPX_VP9_VP9_IFACE_COMMON_H_ 12 13 #include <assert.h> 14 #include "vpx_ports/mem.h" 15 #include "vpx/vp8.h" 16 #include "vpx_scale/yv12config.h" 17 #include "common/vp9_enums.h" 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12, 24 void *user_priv); 25 26 vpx_codec_err_t image2yuvconfig(const vpx_image_t *img, 27 YV12_BUFFER_CONFIG *yv12); 28 29 static INLINE VP9_REFFRAME ref_frame_to_vp9_reframe(vpx_ref_frame_type_t frame)30ref_frame_to_vp9_reframe(vpx_ref_frame_type_t frame) { 31 switch (frame) { 32 case VP8_LAST_FRAME: return VP9_LAST_FLAG; 33 case VP8_GOLD_FRAME: return VP9_GOLD_FLAG; 34 case VP8_ALTR_FRAME: return VP9_ALT_FLAG; 35 } 36 assert(0 && "Invalid Reference Frame"); 37 return VP9_LAST_FLAG; 38 } 39 40 #ifdef __cplusplus 41 } // extern "C" 42 #endif 43 44 #endif // VPX_VP9_VP9_IFACE_COMMON_H_ 45