1 /** 2 * RFX codec encoder 3 * 4 * Copyright 2014-2015 Jay Sorg <jay.sorg@gmail.com> 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 #ifndef __RFXENCODE_H 20 #define __RFXENCODE_H 21 22 struct rfxencode; 23 24 typedef int (*rfx_encode_rgb_to_yuv_proc)(struct rfxencode *enc, 25 const char *rgb_data, 26 int width, int height, 27 int stride_bytes); 28 typedef int (*rfx_encode_argb_to_yuva_proc)(struct rfxencode *enc, 29 const char *argb_data, 30 int width, int height, 31 int stride_bytes); 32 typedef int (*rfx_encode_proc)(struct rfxencode *enc, const char *qtable, 33 const uint8 *data, 34 uint8 *buffer, int buffer_size, int *size); 35 36 struct rfxencode 37 { 38 int width; 39 int height; 40 int frame_idx; 41 int header_processed; 42 int mode; 43 int properties; 44 int flags; 45 int bits_per_pixel; 46 int format; 47 int pad0[7]; 48 49 uint8 a_buffer[4096]; 50 uint8 y_r_buffer[4096]; 51 uint8 u_g_buffer[4096]; 52 uint8 v_b_buffer[4096]; 53 uint8 pad1[16]; 54 sint16 dwt_buffer_a[4096]; 55 sint16 dwt_buffer1_a[4096]; 56 sint16 dwt_buffer2_a[4096]; 57 uint8 pad2[16]; 58 sint16 *dwt_buffer; 59 sint16 *dwt_buffer1; 60 sint16 *dwt_buffer2; 61 rfx_encode_proc rfx_encode; 62 rfx_encode_rgb_to_yuv_proc rfx_encode_rgb_to_yuv; 63 rfx_encode_argb_to_yuva_proc rfx_encode_argb_to_yuva; 64 65 int got_sse2; 66 int got_sse3; 67 int got_sse41; 68 int got_sse42; 69 int got_sse4a; 70 int got_popcnt; 71 int got_lzcnt; 72 int got_neon; 73 }; 74 75 #endif 76