Skip to content

Commit

Permalink
continue cleaning up macro usage
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Nov 13, 2018
1 parent cc60617 commit 1af16fa
Show file tree
Hide file tree
Showing 21 changed files with 473 additions and 508 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ endif (BUILD_SHARED_LIBS)

# pkg-config integration
set(PROJECT_VERSION "0.2")
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name")
set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Installation prefix for executables and object code libraries" FORCE)
set(BIN_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/bin CACHE PATH "Installation prefix for user executables" FORCE)
set(LIB_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH "Installation prefix for object code libraries" FORCE)
Expand All @@ -78,6 +78,6 @@ if (UNIX)
install(TARGETS CineFormShared DESTINATION lib/)
endif (BUILD_SHARED_LIBS)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcineform.pc DESTINATION lib/pkgconfig/)
install(FILES ${PUBLIC_HEADERS} DESTINATION include/libcineform/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcineform.pc DESTINATION lib/pkgconfig/)
endif (UNIX)
38 changes: 19 additions & 19 deletions Codec/InvertHorizontalStrip16s.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void InvertHorizontalStrip16s(PIXEL *lowpass_band, // Horizontal lowpass coeffic
// Place the odd result in the odd column
output[1] = SATURATE(odd);

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first four lowpass coefficients
low1_pi16 = *((__m64 *)&lowpass[column]);
Expand Down Expand Up @@ -1443,7 +1443,7 @@ void InvertHorizontalStripDescale16s(PIXEL *lowpass_band, int lowpass_pitch,
// Place the odd result in the odd column
output[1] = SATURATE(odd);

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first four lowpass coefficients
low1_pi16 = *((__m64 *)&lowpass[column]);
Expand Down Expand Up @@ -2725,7 +2725,7 @@ void InvertHorizontalStripPrescaled16s(PIXEL *lowpass_band, // Horizontal lowpa
// Place the odd result in the odd column
output[1] = SATURATE(odd);

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first four lowpass coefficients
low1_pi16 = *((__m64 *)&lowpass[column]);
Expand Down Expand Up @@ -3486,7 +3486,7 @@ void InvertHorizontalStrip16sToYUYV(PIXEL *lowpass_band[], // Horizontal lowpass
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i y_low1_epi16; // Lowpass coefficients
__m128i y_low2_epi16;
__m128i u_low1_epi16;
Expand Down Expand Up @@ -3663,7 +3663,7 @@ void InvertHorizontalStrip16sToYUYV(PIXEL *lowpass_band[], // Horizontal lowpass
// Save the value for use in the fast loop
v_odd_value = odd;

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
y_low1_epi16 = _mm_load_si128((__m128i *)&y_lowpass_ptr[0]);
Expand Down Expand Up @@ -4738,7 +4738,7 @@ void InvertHorizontalStrip16sToUYVY(PIXEL *lowpass_band[], // Horizontal lowpass
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i y_low1_epi16; // Lowpass coefficients
__m128i y_low2_epi16;
__m128i u_low1_epi16;
Expand Down Expand Up @@ -4915,7 +4915,7 @@ void InvertHorizontalStrip16sToUYVY(PIXEL *lowpass_band[], // Horizontal lowpass
// Save the value for use in the fast loop
v_odd_value = odd;

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
y_low1_epi16 = _mm_load_si128((__m128i *)&y_lowpass_ptr[0]);
Expand Down Expand Up @@ -6496,7 +6496,7 @@ void InvertHorizontalStrip16sToBayerYUV(HorizontalFilterParams)
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i gg_low1_epi16; // Lowpass coefficients
__m128i gg_low2_epi16;
__m128i bg_low1_epi16;
Expand Down Expand Up @@ -6681,7 +6681,7 @@ void InvertHorizontalStrip16sToBayerYUV(HorizontalFilterParams)
// Save the value for use in the fast loop
rg_odd_value = odd;

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
gg_low1_epi16 = _mm_load_si128((__m128i *)&gg_lowpass_ptr[0]);
Expand Down Expand Up @@ -8178,7 +8178,7 @@ void InvertHorizontalStrip16sRGB2YUV(HorizontalFilterParams)
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i gg_low1_epi16; // Lowpass coefficients
__m128i gg_low2_epi16;
__m128i bg_low1_epi16;
Expand Down Expand Up @@ -8362,7 +8362,7 @@ void InvertHorizontalStrip16sRGB2YUV(HorizontalFilterParams)
// Save the value for use in the fast loop
rg_odd_value = odd;

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
gg_low1_epi16 = _mm_load_si128((__m128i *)&gg_lowpass_ptr[0]);
Expand Down Expand Up @@ -9792,7 +9792,7 @@ void InvertHorizontalStrip16sRGBA2YUVA(HorizontalFilterParams)
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i g_low1_epi16; // Lowpass coefficients
__m128i g_low2_epi16;
__m128i b_low1_epi16;
Expand Down Expand Up @@ -10029,7 +10029,7 @@ void InvertHorizontalStrip16sRGBA2YUVA(HorizontalFilterParams)



#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
g_low1_epi16 = _mm_load_si128((__m128i *)&g_lowpass_ptr[0]);
Expand Down Expand Up @@ -11599,7 +11599,7 @@ void InvertHorizontalStrip16sRGB2YR16(HorizontalFilterParams)
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i gg_low1_epi16; // Lowpass coefficients
__m128i gg_low2_epi16;
__m128i bg_low1_epi16;
Expand Down Expand Up @@ -11759,7 +11759,7 @@ void InvertHorizontalStrip16sRGB2YR16(HorizontalFilterParams)
// Save the value for use in the fast loop
rg_odd_value = odd;

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
gg_low1_epi16 = _mm_load_si128((__m128i *)&gg_lowpass_ptr[0]);
Expand Down Expand Up @@ -13029,7 +13029,7 @@ void InvertHorizontalStrip16sRGB2B64A(HorizontalFilterParams)
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i g_low1_epi16; // Lowpass coefficients
__m128i g_low2_epi16;
__m128i b_low1_epi16;
Expand Down Expand Up @@ -13232,7 +13232,7 @@ void InvertHorizontalStrip16sRGB2B64A(HorizontalFilterParams)
a_odd_value = odd;
}

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
g_low1_epi16 = _mm_load_si128((__m128i *)&g_lowpass_ptr[0]);
Expand Down Expand Up @@ -14540,7 +14540,7 @@ void InvertHorizontalStrip16sRGB2RG30(HorizontalFilterParams)
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i gg_low1_epi16; // Lowpass coefficients
__m128i gg_low2_epi16;
__m128i bg_low1_epi16;
Expand Down Expand Up @@ -14693,7 +14693,7 @@ void InvertHorizontalStrip16sRGB2RG30(HorizontalFilterParams)
// Save the value for use in the fast loop
rg_odd_value = odd;

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
gg_low1_epi16 = _mm_load_si128((__m128i *)&gg_lowpass_ptr[0]);
Expand Down
52 changes: 22 additions & 30 deletions Codec/allocator.h
Original file line number Diff line number Diff line change
@@ -1,43 +1,37 @@
/*! @file allocator.h
* @brief Memory tools
*
* @version 1.0.0
*
* (C) Copyright 2017 GoPro Inc (http://gopro.com/).
*
* Licensed under either:
* - Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0
* - MIT license, http://opensource.org/licenses/MIT
* at your option.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*!
* @file allocator.h
* @brief Memory tools
*
* (C) Copyright 2017 GoPro Inc (http://gopro.com/).
*
* Licensed under either:
* - Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0
* - MIT license, http://opensource.org/licenses/MIT
* at your option.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include <stdlib.h>
#include <memory.h>
#include <assert.h>
#include "config.h"
#include <emmintrin.h> // Include support for SSE2 intrinsics
#include <emmintrin.h> // Include support for SSE2 intrinsics

// The codec SDK and the codec library use the same memory allocator
#include "../Common/CFHDAllocator.h"

#define INLINE inline


#ifdef __cplusplus
extern "C" {
#endif

static INLINE void *Alloc(ALLOCATOR *allocator, size_t size)
static inline void *Alloc(ALLOCATOR *allocator, size_t size)
{
#if _ALLOCATOR
//assert(allocator != NULL);
Expand All @@ -53,7 +47,7 @@ static INLINE void *Alloc(ALLOCATOR *allocator, size_t size)
return MEMORY_ALLOC(size);
}

static INLINE void Free(ALLOCATOR *allocator, void *block)
static inline void Free(ALLOCATOR *allocator, void *block)
{
#if _ALLOCATOR
//assert(allocator != NULL);
Expand Down Expand Up @@ -89,7 +83,7 @@ static int m_allocationSize = 0;
#endif


static INLINE void *AllocAligned(ALLOCATOR *allocator, size_t size, size_t alignment)
static inline void *AllocAligned(ALLOCATOR *allocator, size_t size, size_t alignment)
{
void *block = NULL;

Expand Down Expand Up @@ -120,7 +114,7 @@ static INLINE void *AllocAligned(ALLOCATOR *allocator, size_t size, size_t align
return block;
}

static INLINE void FreeAligned(ALLOCATOR *allocator, void *block)
static inline void FreeAligned(ALLOCATOR *allocator, void *block)
{
#if _ALLOCATOR
//assert(allocator != NULL);
Expand Down Expand Up @@ -181,9 +175,7 @@ static INLINE void FreeAligned(ALLOCATOR *allocator, void *block)

assert(found);
}

#endif

}

#ifdef __cplusplus
Expand Down
8 changes: 4 additions & 4 deletions Codec/bayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -14094,7 +14094,7 @@ void InvertHorizontalStrip16sBayerThruLUT(HorizontalFilterParams)
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i gg_low1_epi16; // Lowpass coefficients
__m128i gg_low2_epi16;
__m128i bg_low1_epi16;
Expand Down Expand Up @@ -14251,7 +14251,7 @@ void InvertHorizontalStrip16sBayerThruLUT(HorizontalFilterParams)
// Save the value for use in the fast loop
rg_odd_value = odd;

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
gg_low1_epi16 = _mm_load_si128((__m128i *)&gg_lowpass_ptr[0]);
Expand Down Expand Up @@ -15278,7 +15278,7 @@ void InvertHorizontalStrip16s444ThruLUT(HorizontalFilterParams)
// Process each row of the strip
for (row = 0; row < height; row++)
{
#if (1 && XMMOPT)
#if (XMMOPT)
__m128i gg_low1_epi16; // Lowpass coefficients
__m128i gg_low2_epi16;
__m128i bg_low1_epi16;
Expand Down Expand Up @@ -15435,7 +15435,7 @@ void InvertHorizontalStrip16s444ThruLUT(HorizontalFilterParams)
// Save the value for use in the fast loop
rg_odd_value = odd;

#if (1 && XMMOPT)
#if (XMMOPT)

// Preload the first eight lowpass luma coefficients
gg_low1_epi16 = _mm_load_si128((__m128i *)&gg_lowpass_ptr[0]);
Expand Down
Loading

0 comments on commit 1af16fa

Please sign in to comment.