changeset 235:9054e642786b

Merged multicoreware/xhevc into default
author Deepthi Devaki Akkoorath <deepthidevaki@multicorewareinc.com>
date Wed, 03 Apr 2013 10:39:22 +0530
parents e500456e0146 (current diff) 2ce1d641581a (diff)
children e1ada400cd62
files
diffstat 12 files changed, 313 insertions(+-), 34 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/uncrustify/codingstyle.cfg	Wed Apr 03 10:39:22 2013 +0530
@@ -0,0 +1,234 @@
+#align_same_func_call_params=true
+align_func_params=true
+align_keep_tabs=false
+align_left_shift=true
+align_mix_var_proto=false
+align_nl_cont=false
+align_number_left=false
+align_oc_decl_colon=false
+align_on_operator=false
+align_on_tabstop=false
+align_right_cmt_mix=false
+align_single_line_brace=false
+align_single_line_func=false
+align_var_def_attribute=false
+align_var_def_colon=false
+align_var_def_inline=false
+align_with_tabs=false
+cmt_c_group=true
+cmt_c_nl_end=false
+cmt_c_nl_start=true
+cmt_cpp_group=true
+cmt_cpp_nl_end=false
+cmt_cpp_nl_start=false
+cmt_cpp_to_c=false
+cmt_indent_multi=false
+cmt_insert_before_preproc=false
+cmt_multi_check_last=true
+# do not want to munge HM comments, which can be very far to the right
+# optimally, we would use 2 here for our own new code
+cmt_reflow_mode=1
+cmt_sp_before_star_cont=0
+cmt_star_cont=true
+cmt_width=130
+code_width=130
+eat_blanks_after_open_brace=true
+eat_blanks_before_close_brace=true
+indent_access_spec_body=false
+indent_align_assign=false
+indent_align_string=false
+indent_bool_paren=false
+indent_brace_parent=false
+indent_braces=false
+indent_braces_no_class=false
+indent_braces_no_func=false
+indent_braces_no_struct=false
+indent_class=true
+indent_class_colon=false
+indent_cmt_with_tabs=false
+indent_col1_comment=false
+indent_columns=4
+indent_comma_paren=false
+indent_else_if=false
+indent_extern=false
+indent_first_bool_expr=false
+indent_func_call_param=false
+indent_func_class_param=false
+indent_func_ctor_var_param=false
+indent_func_def_param=false
+indent_func_param_double=false
+indent_func_proto_param=false
+indent_namespace=false
+indent_paren_nl=false
+indent_preserve_sql=false
+indent_relative_single_line_comments=false
+indent_square_nl=false
+indent_template_param=false
+indent_var_def_cont=false
+indent_with_tabs=0
+input_tab_size=2
+ls_for_split_full=true
+ls_func_split_full=true
+mod_add_long_ifdef_else_comment=10
+mod_add_long_ifdef_endif_comment=10
+mod_full_brace_do=add
+mod_full_brace_for=add
+mod_full_brace_if=ignore
+mod_full_brace_if_chain=false
+mod_full_brace_while=add
+mod_full_paren_if_bool=false
+mod_move_case_break=false
+mod_paren_on_return=remove
+mod_pawn_semicolon=false
+mod_remove_empty_return=true
+mod_remove_extra_semicolon=true
+mod_sort_import=false
+mod_sort_include=false
+mod_sort_using=false
+newlines=lf
+nl_after_access_spec=2
+nl_after_brace_close=false
+nl_after_brace_open=true
+nl_after_brace_open_cmt=true
+nl_after_case=false
+nl_after_class=2
+nl_after_for=add
+nl_after_func_body=2
+nl_after_func_body_one_liner=2
+nl_after_if=add
+nl_after_multiline_comment=true
+nl_after_return=false
+nl_after_semicolon=true
+nl_after_struct=2
+nl_after_switch=add
+nl_after_vbrace_close=false
+nl_after_vbrace_open=false
+nl_after_vbrace_open_empty=false
+nl_after_while=add
+nl_assign_brace=add
+nl_assign_leave_one_liners=true
+nl_before_access_spec=2
+nl_before_block_comment=2
+nl_before_case=false
+nl_brace_else=add
+nl_brace_while=add
+nl_case_colon_brace=add
+nl_class_brace=add
+nl_class_init_args=ignore
+nl_class_leave_one_liners=true
+nl_collapse_empty_body=true
+nl_create_for_one_liner=false
+nl_create_if_one_liner=false
+nl_create_while_one_liner=false
+nl_define_macro=false
+nl_do_brace=add
+nl_ds_struct_enum_close_brace=false
+nl_ds_struct_enum_cmt=false
+nl_else_brace=add
+nl_else_if=remove
+nl_elseif_brace=add
+nl_end_of_file=add
+nl_end_of_file_min=1
+nl_enum_brace=add
+nl_enum_leave_one_liners=true
+nl_fdef_brace=add
+nl_for_brace=add
+nl_func_decl_end=remove
+nl_func_decl_start=remove
+nl_func_def_paren=remove
+nl_func_def_start=remove
+nl_func_leave_one_liners=true
+nl_func_paren=remove
+nl_func_proto_type_name=remove
+nl_func_type_name=remove
+nl_func_type_name_class=remove
+nl_func_var_def_blk=2
+nl_getset_leave_one_liners=true
+nl_if_brace=add
+nl_if_leave_one_liners=true
+nl_max=2
+nl_multi_line_cond=false
+nl_multi_line_define=false
+nl_namespace_brace=remove
+nl_return_expr=remove
+nl_squeeze_ifdef=false
+nl_start_of_file=remove
+nl_struct_brace=add
+nl_switch_brace=add
+nl_template_class=add
+nl_while_brace=add
+pp_define_at_level=false
+pp_if_indent_code=false
+pp_indent=remove
+pp_indent_at_level=false
+pp_region_indent_code=false
+sp_addr=remove
+sp_after_angle=remove
+sp_after_cast=remove
+sp_after_class_colon=add
+sp_after_comma=add
+sp_after_dc=remove
+sp_after_new=add
+sp_after_operator=add
+sp_after_operator_sym=remove
+sp_after_semi=remove
+sp_after_type=ignore
+sp_angle_paren=remove
+sp_angle_word=add
+sp_arith=add
+sp_assign=add
+sp_assign_default=add
+sp_attribute_paren=remove
+sp_balance_nested_parens=false
+sp_before_angle=remove
+sp_before_case_colon=remove
+sp_before_class_colon=add
+sp_before_comma=remove
+sp_before_dc=remove
+sp_before_nl_cont=add
+sp_before_semi=remove
+sp_before_semi_for=remove
+sp_before_semi_for_empty=remove
+sp_before_sparen=add
+sp_before_square=remove
+sp_before_squares=remove
+sp_before_tr_emb_cmt=add
+sp_bool=add
+sp_cmt_cpp_start=ignore
+sp_compare=add
+sp_cond_colon=add
+sp_cond_question=add
+sp_cpp_cast_paren=remove
+sp_defined_paren=remove
+sp_deref=remove
+sp_endif_cmt=add
+sp_enum_assign=add
+sp_fparen_brace=add
+sp_func_call_paren=remove
+sp_func_class_paren=remove
+sp_func_def_paren=remove
+sp_func_proto_paren=remove
+sp_incdec=remove
+sp_inside_angle=remove
+sp_inside_braces=add
+sp_inside_braces_empty=remove
+sp_inside_fparen=remove
+sp_inside_fparens=remove
+sp_inside_paren=remove
+sp_inside_paren_cast=remove
+sp_inside_sparen=remove
+sp_inside_square=remove
+sp_inv=remove
+sp_member=remove
+sp_not=remove
+sp_paren_brace=add
+sp_paren_paren=remove
+sp_pp_concat=add
+sp_sign=remove
+sp_sizeof_paren=remove
+sp_special_semi=remove
+sp_template_angle=remove
+tok_split_gte=false
+utf8_bom=remove
+utf8_byte=false
+utf8_force=false
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/uncrustify/uncrustify.bat	Wed Apr 03 10:39:22 2013 +0530
@@ -0,0 +1,45 @@
+@echo off
+
+IF (%1)==() GOTO error
+dir /b /ad %1 >nul 2>nul && GOTO indentDir
+IF NOT EXIST %1 GOTO error
+goto indentFile
+
+:indentDir
+set searchdir=%1
+
+IF (%2)==() GOTO assignDefaultSuffix
+set filesuffix=%2
+
+GOTO run
+
+:assignDefaultSuffix
+::echo !!!!DEFAULT SUFFIX!!!
+set filesuffix=*
+
+:run
+FOR /F "tokens=*" %%G IN ('DIR /B /S %searchdir%\*.%filesuffix%') DO (
+echo Indenting file "%%G"
+uncrustify.exe -f "%%G" -c codingstyle.cfg -o indentoutput.tmp
+move /Y indentoutput.tmp "%%G"
+
+)
+GOTO ende
+
+:indentFile
+echo Indenting one file %1
+uncrustify.exe -f "%1" -c codingstyle.cfg -o indentoutput.tmp
+move /Y indentoutput.tmp "%1"
+
+
+GOTO ende
+
+:error
+echo .
+echo ERROR: As parameter given directory or file does not exist!
+echo Syntax is: call_Uncrustify.bat dirname filesuffix
+echo Syntax is: call_Uncrustify.bat filename
+echo Example: call_Uncrustify.bat temp cpp
+echo .
+
+:ende
Binary file doc/uncrustify/uncrustify.exe has changed
--- a/source/PPA/ppaApi.h	Tue Apr 02 18:05:08 2013 +0530
+++ b/source/PPA/ppaApi.h	Wed Apr 03 10:39:22 2013 +0530
@@ -32,8 +32,8 @@
 #ifndef _PPA_API_H_
 #define _PPA_API_H_
 
-namespace ppa
-{
+namespace ppa {
+// PPA private namespace
 
 typedef unsigned short EventID;
 typedef unsigned char GroupID;
--- a/source/encoder/pixel.cpp	Tue Apr 02 18:05:08 2013 +0530
+++ b/source/encoder/pixel.cpp	Wed Apr 03 10:39:22 2013 +0530
@@ -24,8 +24,8 @@
 #include "primitives.h"
 #include <stdlib.h> // abs()
 
-namespace // place functions in anonymous namespace (file static)
-{
+namespace {
+// place functions in anonymous namespace (file static)
 
 template<int lx, int ly>
 int CDECL sad( pixel *pix1, intptr_t stride_pix1, pixel *pix2, intptr_t stride_pix2 )
--- a/source/encoder/primitives.cpp	Tue Apr 02 18:05:08 2013 +0530
+++ b/source/encoder/primitives.cpp	Wed Apr 03 10:39:22 2013 +0530
@@ -29,8 +29,8 @@
 
 int instrset_detect(void); // from instrset_detect.cpp
 
-namespace x265
-{
+namespace x265 {
+// x265 private namespace
 
 static int8_t psize[8][8] =
 {
@@ -49,9 +49,10 @@ static int8_t psize[8][8] =
 // else returns -1 (in which case you should use the slow path)
 int PartitionFromSizes(int Width, int Height)
 {
-    // If either of these are possible, we must add if() checks for them
-    assert(((Width | Height) & 3) == 0);
-    assert(Width <= 32 && Height <= 32);
+    if ((Width | Height) & ~(4 | 8 | 16 | 32)) // Check for bits in the wrong places
+        return -1;
+    if (Width > 32 || Height > 32)
+        return -1;
     return (int) psize[Width >> 2][Height >> 2];
 }
 
@@ -85,7 +86,7 @@ EncoderPrimitives primitives;
 /* Take all primitive functions from p which are non-NULL */
 static void MergeFunctions(const EncoderPrimitives &p)
 {
-    /* too bad this isn't an introspecive language, but we can use macros */
+    /* too bad this isn't an introspective language, but we can use macros */
 
 #define TAKE_IF_NOT_NULL(FOO) \
     primitives.FOO = p.FOO ? p.FOO : primitives.FOO
--- a/source/encoder/primitives.h	Tue Apr 02 18:05:08 2013 +0530
+++ b/source/encoder/primitives.h	Wed Apr 03 10:39:22 2013 +0530
@@ -50,8 +50,8 @@ typedef uint32_t pixel4;
 #define PIXEL_SPLAT_X4(x) ((x)*0x01010101U)
 #endif
 
-namespace x265
-{
+namespace x265 {
+// x265 private namespace
 
 enum Partitions
 {
--- a/source/encoder/threading.cpp	Tue Apr 02 18:05:08 2013 +0530
+++ b/source/encoder/threading.cpp	Wed Apr 03 10:39:22 2013 +0530
@@ -25,8 +25,8 @@
 
 #include "threading.h"
 
-namespace x265
-{
+namespace x265 {
+// x265 private namespace
 
 #if _WIN32
 
--- a/source/encoder/threading.h	Tue Apr 02 18:05:08 2013 +0530
+++ b/source/encoder/threading.h	Wed Apr 03 10:39:22 2013 +0530
@@ -33,8 +33,8 @@
 #include <stdlib.h>
 #endif
 
-namespace x265
-{
+namespace x265 {
+// x265 private namespace
 
 #ifdef _WIN32
 
--- a/source/encoder/threadpool.cpp	Tue Apr 02 18:05:08 2013 +0530
+++ b/source/encoder/threadpool.cpp	Wed Apr 03 10:39:22 2013 +0530
@@ -40,9 +40,9 @@
 
 #define CLZ64(x)                        __builtin_clzll(x)
 
-#define ATOMIC_OR(ptr,mask)             __sync_or_and_fetch(ptr,mask)
-#define ATOMIC_CAS(ptr,oldval,newval)   __sync_val_compare_and_swap(ptr,oldval,newval)
-#define GIVE_UP_TIME()                  usleep(0);
+#define ATOMIC_OR(ptr, mask)            __sync_or_and_fetch(ptr, mask)
+#define ATOMIC_CAS(ptr, oldval, newval) __sync_val_compare_and_swap(ptr, oldval, newval)
+#define GIVE_UP_TIME()                  usleep(0)
 
 #elif defined(_MSC_VER)                 /* Windows atomic intrinsics */
 
@@ -59,16 +59,17 @@ inline int __lzcnt_2x32(uint64_t x64)
         return val + 32;
     return __lzcnt((uint32_t) x64);
 }
-#endif
 
-#define ATOMIC_OR(ptr,mask)            InterlockedOr64((volatile LONG64*)ptr,mask)
-#define ATOMIC_CAS(ptr,oldval,newval)  InterlockedCompareExchange(ptr,newval,oldval)
-#define GIVE_UP_TIME()                 Sleep(0)
+#endif // if _WIN64
 
-#endif
+#define ATOMIC_OR(ptr, mask)            InterlockedOr64((volatile LONG64*)ptr, mask)
+#define ATOMIC_CAS(ptr, oldval, newval) InterlockedCompareExchange(ptr, newval, oldval)
+#define GIVE_UP_TIME()                  Sleep(0)
 
-namespace x265
-{
+#endif // ifdef __GNUC__
+
+namespace x265 {
+// x265 private namespace
 
 class ThreadPoolImpl;
 
--- a/source/encoder/threadpool.h	Tue Apr 02 18:05:08 2013 +0530
+++ b/source/encoder/threadpool.h	Wed Apr 03 10:39:22 2013 +0530
@@ -28,8 +28,8 @@
 
 #include "stdint.h"
 
-namespace x265
-{
+namespace x265 {
+// x265 private namespace
 
 class ThreadPool;
 
--- a/source/encoder/vec/vecprimitives.inc	Tue Apr 02 18:05:08 2013 +0530
+++ b/source/encoder/vec/vecprimitives.inc	Wed Apr 03 10:39:22 2013 +0530
@@ -30,8 +30,8 @@
 #define EVALUATOR(x,y)   PASTER(x,y)
 #define NAME(fun)        EVALUATOR(fun, ARCH)
 
-namespace // place vector functions in anonymous namespace (file static)
-{
+namespace {
+// place vector functions in anonymous namespace (file static)
 
 #if HIGH_BIT_DEPTH /* 16-bit pixels */
 
@@ -170,11 +170,9 @@ int CDECL NAME(sad_8x8)(pixel *piOrg, in
 
 }  // end anonymous namespace
 
+namespace x265 {
+// Instantiate an EncoderPrimitives instance for this vector architecture
 
-namespace x265
-{
-
-/* Instantiate an EncoderPrimitives instance for this vector architecture */
 EncoderPrimitives NAME(primitives_vectorized);
 
 /* Setup() will be called before main().  It should initialize the