/* * Copyright (c) 2007-2013 Intel Corporation. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef __CONFIGRC_H #define __CONFIGRC_H struct rc_item_t { char *rc_item_name; /* name */ unsigned int *rc_item_ptr; /* value */ }; #define RC_MASK_frame_width (1<<0) #define RC_MASK_frame_height (1<<1) #define RC_MASK_bits_per_second (1<<2) #define RC_MASK_target_percentage (1<<3) #define RC_MASK_window_size (1<<4) #define RC_MASK_initial_qp (1<<5) #define RC_MASK_min_qp (1<<6) #define RC_MASK_force_kf (1<<7) #define RC_MASK_no_ref_last (1<<8) #define RC_MASK_no_ref_gf (1<<9) #define RC_MASK_no_ref_arf (1<<10) #define RC_MASK_frame_rate (1<<11) #define RC_MASK_intra_period (1<<12) #define RC_MASK_intra_idr_period (1<<13) #define RC_MASK_ip_period (1<<14) #define RC_MASK_quality (1<<15) #define RC_MASK_refresh_entropy_probs (1<<16) #define RC_MASK_copy_buffer_to_golden (1<<17) #define RC_MASK_copy_buffer_to_alternate (1<<18) #define RC_MASK_refresh_last (1<<19) #define RC_MASK_refresh_golden_frame (1<<20) #define RC_MASK_refresh_alternate_frame (1<<21) #define RC_MASK_max_qp (1<<22) #define RC_MASK_bits_per_second0 (1<<23) #define RC_MASK_bits_per_second1 (1<<24) #define RC_MASK_bits_per_second2 (1<<25) #define RC_MASK_temporal_layer_id (1<<26) struct rc_param_t { unsigned int mask; unsigned int frame_start; /* Start frame that apply new parameters */ unsigned int frame_end; /* End frame that apply new parameters */ unsigned int frame_width; /* Change resolution */ unsigned int frame_height; /* Change resolution */ unsigned int bits_per_second; /* Reset bitrate */ unsigned int target_percentage; /* Reset target_percentage */ unsigned int window_size; /* Reset window_size */ unsigned int initial_qp; /* Reset initial_qp */ unsigned int min_qp; /* Reset min_qp */ unsigned int max_qp; /* Reset max_qp */ unsigned int force_kf; /* Force the first frame to be a key frame */ unsigned int no_ref_last; /* For the first frame, don't reference the last frame */ unsigned int no_ref_gf; /* For the first frame, don't reference the golden frame */ unsigned int no_ref_arf; /* For the first frame, don't reference the alternate reference frame */ unsigned int frame_rate; /* Reset frame_rate */ unsigned int intra_period; /* Reset intra_period */ unsigned int intra_idr_period; /* Reset intra_idr_period */ unsigned int ip_period; /* Reset ip_period */ unsigned int quality; /* Reset JPEG quality */ unsigned int refresh_entropy_probs; /* probability updates are allowed only at Key frame */ unsigned int copy_buffer_to_golden; /* the golden reference is replaced by another reference */ unsigned int copy_buffer_to_alternate; /* the alternate reference is replaced by another reference */ unsigned int refresh_last; /* determine whether to update last frame update */ unsigned int refresh_golden_frame; /* determine whether to update golden frame update */ unsigned int refresh_alternate_frame; /* determine whether to update alternate frame update*/ unsigned int bits_per_second0; unsigned int bits_per_second1; unsigned int bits_per_second2; unsigned int temporal_layer_id; }; extern struct rc_param_t *rc_params; extern struct rc_param_t *last_rcparam; extern char *config_fn; extern FILE *config_fp; extern FILE *yyin; #ifdef __cplusplus extern "C" { int yylex(void); void yyerror(char *s); int yylex(void); int yywrap(void); void print_rcparam(struct rc_param_t *rc_param); } #endif #endif