57 return (
ui16)((v<<8) | (v>>8));
67 if (c ==
' ' || c ==
'\r' || c ==
'\n' || c ==
'\t')
71 while (c !=
'\n') c = fgetc(fh);
91 int bit_depth,
int count)
96 int max_val = (1 << bit_depth) - 1;
99 for (
ui32 i = count; i > 0; --i)
102 val = val >= 0 ? val : 0;
103 val = val <= max_val ? val : max_val;
110 int bit_depth,
int count)
112 int max_val = (1<<bit_depth) - 1;
117 for (
ui32 i = count; i > 0; --i)
121 val = val >= 0 ? val : 0;
122 val = val <= max_val ? val : max_val;
125 val = val >= 0 ? val : 0;
126 val = val <= max_val ? val : max_val;
129 val = val >= 0 ? val : 0;
130 val = val <= max_val ? val : max_val;
137 int bit_depth,
int count)
141 int max_val = (1<<bit_depth) - 1;
144 for (
ui32 i = count; i > 0; --i)
147 val = val >= 0 ? val : 0;
148 val = val <= max_val ? val : max_val;
155 int bit_depth,
int count)
157 int max_val = (1<<bit_depth) - 1;
162 for (
ui32 i = count; i > 0; --i)
166 val = val >= 0 ? val : 0;
167 val = val <= max_val ? val : max_val;
170 val = val >= 0 ? val : 0;
171 val = val <= max_val ? val : max_val;
174 val = val >= 0 ? val : 0;
175 val = val <= max_val ? val : max_val;
182 int bit_depth,
int count)
186 int max_val = (1<<bit_depth) - 1;
189 for (
ui32 i = count; i > 0; --i)
192 val = val >= 0 ? val : 0;
193 val = val <= max_val ? val : max_val;
200 int bit_depth,
int count)
202 int max_val = (1<<bit_depth) - 1;
207 for (
ui32 i = count; i > 0; --i)
211 val = val >= 0 ? val : 0;
212 val = val <= max_val ? val : max_val;
215 val = val >= 0 ? val : 0;
216 val = val <= max_val ? val : max_val;
219 val = val >= 0 ? val : 0;
220 val = val <= max_val ? val : max_val;
238 fh = fopen(filename,
"rb");
240 OJPH_ERROR(0x030000001,
"Unable to open file %s", filename);
245 if (fread(t, 1, 2,
fh) != 2)
248 OJPH_ERROR(0x030000002,
"Error reading file %s", filename);
252 if (t[0] !=
'P' || (t[1] !=
'5' && t[1] !=
'6'))
255 OJPH_ERROR(0x030000003,
"unknown file type for file %s", filename);
258 size_t len = strlen(filename);
259 if (t[1] ==
'5' && strncmp(filename + len - 4,
".pgm", 4) != 0)
262 OJPH_ERROR(0x030000004,
"wrong file extension, a file with "
263 "keyword P5 must have a .pgm extension for file %s", filename);
265 if (t[1] ==
'6' && strncmp(filename + len - 4,
".ppm", 4) != 0)
268 OJPH_ERROR(0x030000005,
"wrong file extension, a file with keyword P6 "
269 "must have a .ppm extension fir file %s", filename);
280 OJPH_ERROR(0x030000006,
"error in file format for file %s", filename);
302 OJPH_ERROR(0x030000007,
"error allocating mmeory");
333 if (
planar || comp_num == 0)
335 size_t result = fread(
378 assert(
fh == NULL &&
buffer == NULL);
381 size_t len = strlen(filename);
384 if (strncmp(
".ppm", filename + len - 4, 4) == 0)
386 filename[len - 2] =
'g';
387 OJPH_WARN(0x03000001,
"file was renamed %s\n", filename);
389 if (strncmp(
".PPM", filename + len - 4, 4) == 0)
391 filename[len - 2] =
'G';
392 OJPH_WARN(0x03000002,
"file was renamed %s\n", filename);
395 fh = fopen(filename,
"wb");
398 "unable to open file %s for writing", filename);
406 size_t len = strlen(filename);
409 if (strncmp(
".pgm", filename + len - 4, 4) == 0)
411 filename[len - 2] =
'p';
412 OJPH_WARN(0x03000003,
"file was renamed %s\n", filename);
414 if (strncmp(
".PGM", filename + len - 4, 4) == 0)
416 filename[len - 2] =
'P';
417 OJPH_WARN(0x03000004,
"file was renamed %s\n", filename);
420 fh = fopen(filename,
"wb");
423 "unable to open file %s for writing", filename);
427 OJPH_ERROR(0x030000023,
"error writing to file %s", filename);
442 "ppm supports 3 colour components, while pgm supports 1");
464 #ifndef OJPH_DISABLE_INTEL_SIMD
504 lptr[comp_num] = line;
510 size_t result = fwrite(
buffer,
525 #ifdef OJPH_ENABLE_TIFF_SUPPORT
527 void tif_in::open(
const char* filename)
530 if ((tiff_handle = TIFFOpen(filename,
"r")) == NULL)
531 OJPH_ERROR(0x0300000B1,
"Unable to open file %s", filename);
535 ui32 tiff_height = 0;
536 TIFFGetField(tiff_handle, TIFFTAG_IMAGEWIDTH, &tiff_width);
537 TIFFGetField(tiff_handle, TIFFTAG_IMAGELENGTH, &tiff_height);
539 ui16 tiff_bits_per_sample = 0;
540 ui16 tiff_samples_per_pixel = 0;
541 TIFFGetField(tiff_handle, TIFFTAG_BITSPERSAMPLE, &tiff_bits_per_sample);
542 TIFFGetField(tiff_handle, TIFFTAG_SAMPLESPERPIXEL, &tiff_samples_per_pixel);
545 tiff_samples_per_pixel =
546 (tiff_samples_per_pixel < 1) ? 1 : tiff_samples_per_pixel;
548 ui16 tiff_planar_configuration = 0;
549 ui16 tiff_photometric = 0;
550 TIFFGetField(tiff_handle, TIFFTAG_PLANARCONFIG, &tiff_planar_configuration);
551 TIFFGetField(tiff_handle, TIFFTAG_PHOTOMETRIC, &tiff_photometric);
553 planar_configuration = tiff_planar_configuration;
555 ui16 tiff_compression = 0;
556 ui32 tiff_rows_per_strip = 0;
557 TIFFGetField(tiff_handle, TIFFTAG_COMPRESSION, &tiff_compression);
558 TIFFGetField(tiff_handle, TIFFTAG_ROWSPERSTRIP, &tiff_rows_per_strip);
560 if (tiff_planar_configuration == PLANARCONFIG_SEPARATE)
562 bytes_per_line = tiff_samples_per_pixel * TIFFScanlineSize64(tiff_handle);
566 bytes_per_line = TIFFScanlineSize64(tiff_handle);
569 line_buffer = malloc(bytes_per_line);
570 if (NULL == line_buffer)
571 OJPH_ERROR(0x0300000B2,
"Unable to allocate %d bytes for line_buffer[] "
572 "for file %s", bytes_per_line, filename);
577 if( tiff_bits_per_sample != 8 && tiff_bits_per_sample != 16 )
579 OJPH_ERROR(0x0300000B3,
"\nTIFF IO is currently limited to file limited"
580 " to files with TIFFTAG_BITSPERSAMPLE=8 and TIFFTAG_BITSPERSAMPLE=16 \n"
581 "input file = %s has TIFFTAG_BITSPERSAMPLE=%d",
582 filename, tiff_bits_per_sample);
585 if( TIFFIsTiled( tiff_handle ) )
587 OJPH_ERROR(0x0300000B4,
"\nTIFF IO is currently limited to TIF files "
588 "without tiles. \nInput file %s has been detected as tiled", filename);
591 if(PHOTOMETRIC_RGB != tiff_photometric &&
592 PHOTOMETRIC_MINISBLACK != tiff_photometric )
594 OJPH_ERROR(0x0300000B5,
"\nTIFF IO is currently limited to "
595 "TIFFTAG_PHOTOMETRIC=PHOTOMETRIC_MINISBLACK=%d and "
596 "PHOTOMETRIC_RGB=%d. \nInput file %s has been detected "
597 "TIFFTAG_PHOTOMETRIC=%d",
598 PHOTOMETRIC_MINISBLACK, PHOTOMETRIC_RGB, filename, tiff_photometric);
601 if( tiff_samples_per_pixel > 4 )
603 OJPH_ERROR(0x0300000B6,
"\nTIFF IO is currently limited to "
604 "TIFFTAG_SAMPLESPERPIXEL=4 \nInput file %s has been detected with "
605 "TIFFTAG_SAMPLESPERPIXEL=%d",
606 filename, tiff_samples_per_pixel);
611 height = tiff_height;
612 num_comps = tiff_samples_per_pixel;
613 bytes_per_sample = (tiff_bits_per_sample + 7) / 8;
614 for (
ui32 comp_num = 0; comp_num < num_comps; comp_num++)
615 bit_depth[comp_num] = tiff_bits_per_sample;
619 if (tiff_planar_configuration == PLANARCONFIG_SEPARATE &&
620 bytes_per_sample == 1)
622 line_buffer_for_planar_support_uint8 =
623 (uint8_t*)calloc(width,
sizeof(uint8_t));
624 if (NULL == line_buffer_for_planar_support_uint8)
625 OJPH_ERROR(0x0300000B7,
"Unable to allocate %d bytes for "
626 "line_buffer_for_planar_support_uint8[] for file %s",
627 width *
sizeof(uint8_t), filename);
629 if (tiff_planar_configuration == PLANARCONFIG_SEPARATE &&
630 bytes_per_sample == 2)
632 line_buffer_for_planar_support_uint16 =
633 (uint16_t*)calloc(width,
sizeof(uint16_t));
634 if (NULL == line_buffer_for_planar_support_uint16)
635 OJPH_ERROR(0x0300000B8,
"Unable to allocate %d bytes for "
636 "line_buffer_for_planar_support_uint16[] for file %s",
637 width *
sizeof(uint16_t), filename);
644 void tif_in::set_bit_depth(
ui32 num_bit_depths,
ui32* bit_depth)
646 if (num_bit_depths < 1)
647 OJPH_ERROR(0x030000B9,
"one or more bit_depths must be provided");
648 ui32 last_bd_idx = 0;
649 for (
ui32 i = 0; i < 4; ++i)
651 ui32 bd = bit_depth[i < num_bit_depths ? i : last_bd_idx];
652 last_bd_idx += last_bd_idx + 1 < num_bit_depths ? 1 : 0;
654 if (bd > 32 || bd < 1)
657 "bit_depth = %d, this must be an integer from 1-32", bd);
659 this->bit_depth[i] = bd;
664 ui32 tif_in::read(
const line_buf* line,
ui32 comp_num)
666 assert(bytes_per_line != 0 && tiff_handle != 0 && comp_num < num_comps);
667 assert((
ui32)line->size >= width);
671 if (PLANARCONFIG_SEPARATE == planar_configuration && 0 == comp_num )
673 for (
unsigned short color = 0; color < num_comps; color++)
675 if (bytes_per_sample == 1)
677 TIFFReadScanline(tiff_handle, line_buffer_for_planar_support_uint8,
680 uint8_t* line_buffer_of_interleaved_components =
681 (uint8_t*)line_buffer;
682 for (
ui32 i = 0; i < width; i++, x += num_comps)
684 line_buffer_of_interleaved_components[x] =
685 line_buffer_for_planar_support_uint8[i];
688 else if (bytes_per_sample == 2)
690 TIFFReadScanline(tiff_handle, line_buffer_for_planar_support_uint16,
693 ui16* line_buffer_of_interleaved_components = (
ui16*)line_buffer;
694 for (
ui32 i = 0; i < width; i++, x += num_comps)
696 line_buffer_of_interleaved_components[x] =
697 line_buffer_for_planar_support_uint16[i];
704 else if (planar_configuration == PLANARCONFIG_CONTIG && 0 == comp_num)
706 TIFFReadScanline(tiff_handle, line_buffer, cur_line++);
708 if (cur_line >= height)
713 if (bytes_per_sample == 1)
715 const ui8* sp = (
ui8*)line_buffer + comp_num;
716 si32* dp = line->i32;
717 if (bit_depth[comp_num] == 8)
719 for (
ui32 i = width; i > 0; --i, sp += num_comps)
722 else if (bit_depth[comp_num] < 8)
725 const int bits_to_shift = 8 - (int)bit_depth[comp_num];
726 const int bit_mask = (1 << bit_depth[comp_num]) - 1;
727 for (
ui32 i = width; i > 0; --i, sp += num_comps)
728 *dp++ = (
si32) (((*sp) >> bits_to_shift) & bit_mask);
730 else if (bit_depth[comp_num] > 8)
732 const int bits_to_shift = (int)bit_depth[comp_num] - 8;
733 const int bit_mask = (1 << bit_depth[comp_num]) - 1;
734 for (
ui32 i = width; i > 0; --i, sp += num_comps)
735 *dp++ = (
si32)(((*sp) << bits_to_shift) & bit_mask);
738 else if(bytes_per_sample == 2)
740 if (bit_depth[comp_num] == 16)
742 const ui16* sp = (
ui16*)line_buffer + comp_num;
743 si32* dp = line->i32;
744 for (
ui32 i = width; i > 0; --i, sp += num_comps)
747 else if (bit_depth[comp_num] < 16)
750 const int bits_to_shift = 16 - (int)bit_depth[comp_num];
751 const int bit_mask = (1 << bit_depth[comp_num]) - 1;
752 const ui16* sp = (
ui16*)line_buffer + comp_num;
753 si32* dp = line->i32;
754 for (
ui32 i = width; i > 0; --i, sp += num_comps)
755 *dp++ = (
si32)(((*sp) >> bits_to_shift) & bit_mask);
757 else if (bit_depth[comp_num] > 16)
759 const int bits_to_shift = (int)bit_depth[comp_num] - 16;
760 const int bit_mask = (1 << bit_depth[comp_num]) - 1;
761 const ui16* sp = (
ui16*)line_buffer + comp_num;
762 si32* dp = line->i32;
763 for (
ui32 i = width; i > 0; --i, sp += num_comps)
764 *dp++ = (
si32)(((*sp) << bits_to_shift) & bit_mask);
781 void tif_out::open(
char* filename)
784 ui32 max_bitdepth = 0;
785 for (
ui32 c = 0; c < num_components; c++)
787 if (bit_depth_of_data[c] > max_bitdepth)
788 max_bitdepth = bit_depth_of_data[c];
790 if (max_bitdepth > 16)
792 OJPH_WARN(0x0300000C2,
"TIFF output is currently limited to files "
793 "with max_bitdepth = 16, the source codestream has max_bitdepth=%d"
794 ", the decoded data will be truncated to 16 bits", max_bitdepth);
796 if (num_components > 4)
798 OJPH_ERROR(0x0300000C3,
"TIFF IO is currently limited to files with "
799 "num_components=1 to 4");
802 assert(tiff_handle == NULL && buffer == NULL);
803 if ((tiff_handle = TIFFOpen(filename,
"w")) == NULL)
805 OJPH_ERROR(0x0300000C1,
"unable to open file %s for writing", filename);
808 buffer_size = width * num_components * bytes_per_sample;
809 buffer = (
ui8*)malloc(buffer_size);
816 TIFFSetField(tiff_handle, TIFFTAG_IMAGEWIDTH, width);
817 TIFFSetField(tiff_handle, TIFFTAG_IMAGELENGTH, height);
819 TIFFSetField(tiff_handle, TIFFTAG_BITSPERSAMPLE, bytes_per_sample * 8);
820 TIFFSetField(tiff_handle, TIFFTAG_SAMPLESPERPIXEL, num_components);
822 planar_configuration = PLANARCONFIG_CONTIG;
823 TIFFSetField(tiff_handle, TIFFTAG_PLANARCONFIG, planar_configuration);
825 if (num_components == 1)
827 TIFFSetField(tiff_handle, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
829 else if (num_components == 2)
831 TIFFSetField(tiff_handle, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
834 const ui16 extra_samples_description[1] = { EXTRASAMPLE_ASSOCALPHA };
835 TIFFSetField(tiff_handle, TIFFTAG_EXTRASAMPLES, (uint16_t)1,
836 &extra_samples_description);
838 else if (num_components == 3)
840 TIFFSetField(tiff_handle, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
842 else if (num_components == 4)
844 TIFFSetField(tiff_handle, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
847 const ui16 extra_samples_description[1] = { EXTRASAMPLE_ASSOCALPHA };
848 TIFFSetField(tiff_handle, TIFFTAG_EXTRASAMPLES, (uint16_t)1,
849 &extra_samples_description);
852 TIFFSetField(tiff_handle, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
853 TIFFSetField(tiff_handle, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
855 TIFFSetField(tiff_handle, TIFFTAG_ROWSPERSTRIP, height);
860 void tif_out::configure(
ui32 width,
ui32 height,
ui32 num_components,
863 assert(tiff_handle == NULL);
866 this->height = height;
867 this->num_components = num_components;
868 ui32 max_bitdepth = 0;
869 for (
ui32 c = 0; c < num_components; c++)
871 this->bit_depth_of_data[c] = bit_depth[c];
872 if (bit_depth[c] > max_bitdepth)
873 max_bitdepth = bit_depth[c];
876 bytes_per_sample = (max_bitdepth + 7) / 8;
877 if (bytes_per_sample > 2)
881 bytes_per_sample = 2;
883 samples_per_line = num_components * width;
884 bytes_per_line = bytes_per_sample * samples_per_line;
889 ui32 tif_out::write(
const line_buf* line,
ui32 comp_num)
893 if (bytes_per_sample == 1)
895 int max_val = (1 << bit_depth_of_data[comp_num]) - 1;
896 const si32* sp = line->i32;
897 ui8* dp = buffer + comp_num;
898 if (bit_depth_of_data[comp_num] == 8)
900 for (
ui32 i = width; i > 0; --i, dp += num_components)
904 val = val >= 0 ? val : 0;
905 val = val <= max_val ? val : max_val;
909 else if (bit_depth_of_data[comp_num] < 8)
911 const int bits_to_shift = 8 - (int)bit_depth_of_data[comp_num];
912 const int bit_mask = (1 << bit_depth_of_data[comp_num]) - 1;
913 for (
ui32 i = width; i > 0; --i, dp += num_components)
917 val = val >= 0 ? val : 0;
918 val = val <= max_val ? val : max_val;
921 *dp = (
ui8)((val & bit_mask) << bits_to_shift);
924 else if (bit_depth_of_data[comp_num] > 8)
926 const int bits_to_shift = (int)bit_depth_of_data[comp_num] - 8;
927 const int bit_mask = (1 << bit_depth_of_data[comp_num]) - 1;
928 for (
ui32 i = width; i > 0; --i, dp += num_components)
932 val = val >= 0 ? val : 0;
933 val = val <= max_val ? val : max_val;
936 *dp = (
ui8)((val >> bits_to_shift) & bit_mask);
941 else if(bytes_per_sample == 2)
943 int max_val = (1 << bit_depth_of_data[comp_num]) - 1;
944 const si32* sp = line->i32;
945 ui16* dp = (
ui16*)buffer + comp_num;
947 if (bit_depth_of_data[comp_num] == 16)
949 for (
ui32 i = width; i > 0; --i, dp += num_components)
953 val = val >= 0 ? val : 0;
954 val = val <= max_val ? val : max_val;
958 else if (bit_depth_of_data[comp_num] < 16)
960 const int bits_to_shift = 16 - (int)bit_depth_of_data[comp_num];
961 const int bit_mask = (1 << bit_depth_of_data[comp_num]) - 1;
962 for (
ui32 i = width; i > 0; --i, dp += num_components)
966 val = val >= 0 ? val : 0;
967 val = val <= max_val ? val : max_val;
971 *dp = (
ui16)((val & bit_mask) << bits_to_shift);
974 else if (bit_depth_of_data[comp_num] > 16)
976 const int bits_to_shift = (int)bit_depth_of_data[comp_num] - 16;
977 const int bit_mask = (1 << bit_depth_of_data[comp_num]) - 1;
978 for (
ui32 i = width; i > 0; --i, dp += num_components)
982 val = val >= 0 ? val : 0;
983 val = val <= max_val ? val : max_val;
987 *dp = (
ui16)((val >> bits_to_shift) & bit_mask);
993 if (comp_num == num_components-1)
995 int result = TIFFWriteScanline(tiff_handle, buffer, cur_line++);
997 OJPH_ERROR(0x0300000C4,
"error writing to file %s", fname);
1015 fh = fopen(filename,
"rb");
1017 OJPH_ERROR(0x03000051,
"Unable to open file %s", filename);
1042 if (result !=
width[comp_num])
1052 for (
ui32 i =
width[comp_num]; i > 0; --i, ++sp)
1059 for (
ui32 i =
width[comp_num]; i > 0; --i, ++sp)
1063 return width[comp_num];
1068 ui32 num_downsamplings,
const point *subsampling)
1070 if (num_components != 1 && num_components !=3)
1071 OJPH_ERROR(0x03000071,
"yuv_in support 1 or 3 components");
1072 this->
num_com = num_components;
1074 if (num_downsamplings < 1)
1075 OJPH_ERROR(0x03000072,
"one or more downsampling must be provided");
1077 ui32 last_downsamp_idx = 0;
1078 for (
ui32 i = 0; i < num_components; ++i)
1081 last_downsamp_idx += last_downsamp_idx + 1 < num_downsamplings ? 1 : 0;
1083 this->subsampling[i] = cp_ds;
1086 for (
ui32 i = 0; i < num_components; ++i)
1096 if (num_bit_depths < 1)
1097 OJPH_ERROR(0x03000081,
"one or more bit_depths must be provided");
1098 ui32 last_bd_idx = 0;
1099 for (
ui32 i = 0; i < 3; ++i)
1102 last_bd_idx += last_bd_idx + 1 < num_bit_depths ? 1 : 0;
1104 this->bit_depth[i] = bd;
1137 fh = fopen(filename,
"wb");
1139 OJPH_ERROR(0x03000091,
"Unable to open file %s", filename);
1155 tw =
ojph_max(tw, this->comp_width[i]);
1174 for (
ui32 i = w; i > 0; --i)
1177 val = val >= 0 ? val : 0;
1178 val = val <= max_val ? val : max_val;
1188 for (
ui32 i = w; i > 0; --i)
1191 val = val >= 0 ? val : 0;
1192 val = val <= max_val ? val : max_val;
void pre_alloc_data(size_t num_ele, ui32 pre_size)
T * post_alloc_data(size_t num_ele, ui32 pre_size)
void open(const char *filename)
mem_fixed_allocator * alloc_p
virtual ui32 read(const line_buf *line, ui32 comp_num)
void open(char *filename)
virtual ui32 write(const line_buf *line, ui32 comp_num)
void configure(ui32 width, ui32 height, ui32 num_components, ui32 bit_depth)
virtual ui32 read(const line_buf *line, ui32 comp_num)
void open(const char *filename)
void set_img_props(const size &s, ui32 num_components, ui32 num_downsampling, const point *downsampling)
void set_bit_depth(ui32 num_bit_depths, ui32 *bit_depth)
void open(char *filename)
void configure(ui32 bit_depth, ui32 num_components, ui32 *comp_width)
virtual ui32 write(const line_buf *line, ui32 comp_num)
void gen_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
int ojph_fseek(FILE *stream, si64 offset, int origin)
void avx2_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
static void eat_white_spaces(FILE *fh)
void sse41_cvrt_32b3c_to_16ub3c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
si64 ojph_ftell(FILE *stream)
void gen_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
void sse41_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
@ X86_CPU_EXT_LEVEL_SSE41
void avx2_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
void sse41_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
void gen_cvrt_32b3c_to_16ub3c_le(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
void gen_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
static ui16 be2le(const ui16 v)
static ui32 count_leading_zeros(ui32 val)
void gen_cvrt_32b3c_to_16ub3c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
void avx2_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
void sse41_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
void gen_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, int bit_depth, int count)
#define ojph_div_ceil(a, b)
#define OJPH_ERROR(t,...)