libvisiontransfer  5.2.0
bitconversions.h
1 /*******************************************************************************
2  * Copyright (c) 2018 Nerian Vision Technologies
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *******************************************************************************/
14 
15 #ifndef VISIONTRANSFER_BITCONVERSIONS_H
16 #define VISIONTRANSFER_BITCONVERSIONS_H
17 
23 public:
24  static void decode12BitSplit(int startRow, int stopRow, const unsigned char* src,
25  unsigned char* dst, int srcStride, int dstStride, int rowWidth);
26 
27  static void decode12BitPacked(int startRow, int stopRow, const unsigned char* src,
28  unsigned char* dst, int srcStride, int dstStride, int rowWidth);
29 
30  static void encode12BitPacked(int startRow, int stopRow, const unsigned char* src,
31  unsigned char* dst, int srcStride, int dstStride, int rowWidth);
32 
33 private:
34  template <bool alignedLoad>
35  static void decode12BitSplitSSE2(int startRow, int stopRow, const unsigned char* dispStart,
36  const unsigned char* subpixStart, int width, unsigned short* dst, int srcStride, int dstStride);
37 
38  template <bool alignedLoad>
39  static void decode12BitSplitAVX2(int startRow, int stopRow, const unsigned char* dispStart,
40  const unsigned char* subpixStart, int width, unsigned short* dst, int srcStride, int dstStride);
41 
42  static void decode12BitSplitFallback(int startRow, int stopRow, const unsigned char* dispStart,
43  const unsigned char* subpixStart, int width, unsigned short* dst, int srcStride, int dstStride);
44 
45  template <bool alignedLoad>
46  static void decode12BitPackedSSE4(int startRow, int stopRow, const unsigned char* dispStart,
47  int width, unsigned short* dst, int srcStride, int dstStride);
48 
49  template <bool alignedLoad>
50  static void decode12BitPackedNEON(int startRow, int stopRow, const unsigned char* dispStart,
51  int width, unsigned short* dst, int srcStride, int dstStride);
52 
53  static void decode12BitPackedFallback(int startRow, int stopRow, const unsigned char* dispStart,
54  int width, unsigned short* dst, int srcStride, int dstStride);
55 };
56 
57 #endif
Various implementations for converting from 12-bit to 16-bit per pixels formats.
Nerian Vision Technologies