kopia lustrzana https://github.com/gopro/gpr
WIP testing other phases
rodzic
e956c5961b
commit
a8e8a6d531
|
@ -55,6 +55,8 @@ public:
|
|||
int input_pitch;
|
||||
|
||||
int input_skip_rows;
|
||||
|
||||
int input_header_skip;
|
||||
|
||||
string input_pixel_format;
|
||||
|
||||
|
@ -98,8 +100,10 @@ public:
|
|||
|
||||
("InputHeight,h", input_height, 3000, "Input image height in pixel samples [3000]")
|
||||
|
||||
("InputPitch,p", input_pitch, 8000, "Input image pitch in bytes [8000]")
|
||||
|
||||
("InputPitch,p", input_pitch, 8000, "Input image pitch in bytes [8000]")
|
||||
|
||||
("InputHeaderSkip,b", input_header_skip, -1, "Skip any raw header in bytes e.g. 256")
|
||||
|
||||
("InputPixelFormat,x", input_pixel_format, string("rggb14"), "Input pixel format \n(rggb12, rggb12p, [rggb14], gbrg12, gbrg12p)")
|
||||
|
||||
("ApplyGprParameters,a", apply_gpr_parameters, string(""), "Parameters to use for GPR or DNG file.")
|
||||
|
@ -152,7 +156,7 @@ int main(int argc, char *argv [])
|
|||
char line[MAX_STDOUT_LINE];
|
||||
sprintf( line, "GPR Tools Version %d.%d.%d [%s @ %s] ", GPR_VERSION_MAJOR, GPR_VERSION_MINOR, GPR_VERSION_REVISION, GIT_BRANCH, GIT_COMMIT_HASH );
|
||||
|
||||
if( args.parse(argc, argv, line, zerotag) )
|
||||
if( argc == 1 || args.parse(argc, argv, line, zerotag) )
|
||||
{
|
||||
printf("\n");
|
||||
printf("-- Example Commnads (please see data/tests/run_tests.sh for more examples) --\n");
|
||||
|
@ -193,7 +197,7 @@ int main(int argc, char *argv [])
|
|||
|
||||
if( args.output_file_path != "" )
|
||||
{
|
||||
return dng_convert_main(args.input_file_path.c_str(), args.input_width, args.input_height, args.input_pitch, args.input_skip_rows, args.input_pixel_format.c_str(),
|
||||
return dng_convert_main(args.input_file_path.c_str(), args.input_width, args.input_height, args.input_pitch, args.input_skip_rows, args.input_header_skip, args.input_pixel_format.c_str(),
|
||||
args.output_file_path.c_str(), args.apply_gpr_parameters.c_str(), args.gpmf_file_path.c_str(), args.rgb_file_resolution.c_str(), args.rgb_file_bits,
|
||||
args.jpg_preview_file_path.c_str(), args.jpg_preview_file_width, args.jpg_preview_file_height );
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ static FILE_TYPE GetFileType( const char* file_path )
|
|||
return FILE_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
int dng_convert_main(const char* input_file_path, unsigned int input_width, unsigned int input_height, size_t input_pitch, size_t input_skip_rows, const char* input_pixel_format,
|
||||
int dng_convert_main(const char* input_file_path, unsigned int input_width, unsigned int input_height, size_t input_pitch, size_t input_skip_rows, size_t input_header_skip, const char* input_pixel_format,
|
||||
const char* output_file_path, const char* metadata_file_path, const char* gpmf_file_path, const char* rgb_file_resolution, int rgb_file_bits,
|
||||
const char* jpg_preview_file_path, int jpg_preview_file_width, int jpg_preview_file_height )
|
||||
{
|
||||
|
@ -159,7 +159,7 @@ int dng_convert_main(const char* input_file_path, unsigned int input_width, uns
|
|||
if( input_pitch == -1 )
|
||||
input_pitch = input_width * 2;
|
||||
}
|
||||
if( strcmp(input_pixel_format, "rggb12p") == 0 )
|
||||
else if( strcmp(input_pixel_format, "rggb12p") == 0 )
|
||||
{
|
||||
params.tuning_info.pixel_format = PIXEL_FORMAT_RGGB_12P;
|
||||
|
||||
|
@ -189,6 +189,15 @@ int dng_convert_main(const char* input_file_path, unsigned int input_width, uns
|
|||
if( input_pitch == -1 )
|
||||
input_pitch = (input_width * 3 / 4) * 2;
|
||||
}
|
||||
else if (strcmp(input_pixel_format, "gbrg14") == 0)
|
||||
{
|
||||
params.tuning_info.pixel_format = PIXEL_FORMAT_GBRG_14;
|
||||
|
||||
saturation_level = (1 << 14) - 1;
|
||||
|
||||
if (input_pitch == -1)
|
||||
input_pitch = input_width * 2;
|
||||
}
|
||||
|
||||
params.tuning_info.dgain_saturation_level.level_red = saturation_level;
|
||||
params.tuning_info.dgain_saturation_level.level_green_even = saturation_level;
|
||||
|
@ -203,10 +212,14 @@ int dng_convert_main(const char* input_file_path, unsigned int input_width, uns
|
|||
|
||||
gpr_buffer output_buffer = { NULL, 0 };
|
||||
|
||||
if( input_skip_rows > 0 )
|
||||
{
|
||||
input_buffer.buffer = (unsigned char*)(input_buffer.buffer) + (input_skip_rows * input_pitch);
|
||||
}
|
||||
if (input_skip_rows > 0)
|
||||
{
|
||||
input_buffer.buffer = (unsigned char*)(input_buffer.buffer) + (input_skip_rows * input_pitch);
|
||||
}
|
||||
if (input_header_skip > 0)
|
||||
{
|
||||
input_buffer.buffer = (unsigned char*)(input_buffer.buffer) + (input_header_skip);
|
||||
}
|
||||
|
||||
gpr_buffer preview = { NULL, 0 };
|
||||
|
||||
|
@ -328,12 +341,7 @@ int dng_convert_main(const char* input_file_path, unsigned int input_width, uns
|
|||
{
|
||||
write_to_file( &output_buffer, output_file_path );
|
||||
}
|
||||
|
||||
if( input_skip_rows > 0 )
|
||||
{
|
||||
input_buffer.buffer = (unsigned char*)(input_buffer.buffer) - (input_skip_rows * input_pitch);
|
||||
}
|
||||
|
||||
|
||||
if( preview.buffer )
|
||||
{
|
||||
allocator.Free( preview.buffer );
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
int dng_convert_main(const char* input_file_path, unsigned int input_width, unsigned int input_height, size_t input_pitch, size_t input_skip_rows, const char* input_pixel_format,
|
||||
int dng_convert_main(const char* input_file_path, unsigned int input_width, unsigned int input_height, size_t input_pitch, size_t input_skip_rows, size_t input_header_skip, const char* input_pixel_format,
|
||||
const char* output_file_path, const char* exiftool_file_path, const char* gpmf_file_path, const char* rgb_file_resolution, int rgb_file_bits,
|
||||
const char* jpg_preview_file_path, int jpg_preview_file_width, int jpg_preview_file_height );
|
||||
|
||||
|
|
|
@ -52,6 +52,8 @@ public:
|
|||
int input_pitch;
|
||||
|
||||
int input_skip_rows;
|
||||
|
||||
int input_skip_bytes;
|
||||
|
||||
string log_curve_file_path;
|
||||
|
||||
|
@ -71,23 +73,17 @@ public:
|
|||
{
|
||||
command_options.addOptions()
|
||||
/* long and short name */ /* variable to update */ /* default value */ /* help text */
|
||||
("help", help, false, "Prints this help text")
|
||||
("verbose", verbose, false, "Verbosity of the output")
|
||||
|
||||
("InputFilePath,i", input_file_path, string(""), "Input file path")
|
||||
|
||||
("InputWidth,w", input_width, 4000, "Input image width in pixel samples e.g. 4000")
|
||||
|
||||
("InputHeight,h", input_height, 3000, "Input image height in pixel samples e.g. 3000")
|
||||
|
||||
("InputPitch,p", input_pitch, -1, "Input image pitch in bytes e.g. 8000")
|
||||
|
||||
("InputPixelFormat,x", input_pixel_format, string("rggb14"), "Input pixel format [rggb12, rggb12p, rggb14, gbrg12, gbrg12p]")
|
||||
|
||||
("OutputFilePath,o", output_file_path, string(""), "Output file path")
|
||||
|
||||
("PrintLogCurve,l", log_curve_file_path, string(""), "File for encoding log curve output");
|
||||
;
|
||||
("help", help, false, "Prints this help text")
|
||||
("verbose", verbose, false, "Verbosity of the output")
|
||||
("InputFilePath,i", input_file_path, string(""), "Input file path")
|
||||
("InputWidth,w", input_width, 4000, "Input image width in pixel samples e.g. 4000")
|
||||
("InputHeight,h", input_height, 3000, "Input image height in pixel samples e.g. 3000")
|
||||
("InputPitch,p", input_pitch, -1, "Input image pitch in bytes e.g. 8000")
|
||||
("InputSkip,s", input_skip_bytes, -1, "Skip any raw header in bytes e.g. 256")
|
||||
("InputPixelFormat,x", input_pixel_format, string("rggb14"), "Input pixel format [rggb12, rggb12p, rggb14, gbrg12, gbrg12p]")
|
||||
("OutputFilePath,o", output_file_path, string(""), "Output file path")
|
||||
("PrintLogCurve,l", log_curve_file_path, string(""), "File for encoding log curve output");
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -135,20 +131,27 @@ int main(int argc, char *argv[])
|
|||
if( args.input_pitch == -1 )
|
||||
vc5_encoder_params.input_pitch = args.input_width * 2;
|
||||
}
|
||||
if( strcmp(args.input_pixel_format.c_str(), "rggb12p") == 0 )
|
||||
else if( strcmp(args.input_pixel_format.c_str(), "rggb12p") == 0 )
|
||||
{
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_RGGB_12P;
|
||||
|
||||
if( args.input_pitch == -1 )
|
||||
vc5_encoder_params.input_pitch = (args.input_width * 3 / 4) * 2;
|
||||
}
|
||||
else if( strcmp(args.input_pixel_format.c_str(), "rggb14") == 0 )
|
||||
{
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_RGGB_14;
|
||||
else if (strcmp(args.input_pixel_format.c_str(), "rggb14") == 0)
|
||||
{
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_RGGB_14;
|
||||
|
||||
if( args.input_pitch == -1 )
|
||||
args.input_pitch = args.input_width * 2;
|
||||
}
|
||||
if (args.input_pitch == -1)
|
||||
args.input_pitch = args.input_width * 2;
|
||||
}
|
||||
else if (strcmp(args.input_pixel_format.c_str(), "rggb16") == 0)
|
||||
{
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_RGGB_16;
|
||||
|
||||
if (args.input_pitch == -1)
|
||||
args.input_pitch = args.input_width * 2;
|
||||
}
|
||||
else if( strcmp(args.input_pixel_format.c_str(), "gbrg12") == 0 )
|
||||
{
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_GBRG_12;
|
||||
|
@ -163,9 +166,23 @@ int main(int argc, char *argv[])
|
|||
if( args.input_pitch == -1 )
|
||||
args.input_pitch = (args.input_width * 3 / 4) * 2;
|
||||
}
|
||||
else if (strcmp(args.input_pixel_format.c_str(), "gbrg14") == 0)
|
||||
{
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_GBRG_14;
|
||||
|
||||
if (args.input_pitch == -1)
|
||||
args.input_pitch = args.input_width * 2;
|
||||
}
|
||||
else if (strcmp(args.input_pixel_format.c_str(), "gbrg16") == 0)
|
||||
{
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_GBRG_16;
|
||||
|
||||
if (args.input_pitch == -1)
|
||||
args.input_pitch = args.input_width * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogPrint("Invalid input format: %s", args.input_pixel_format.c_str());
|
||||
LogPrint("Invalid input format: \"%s\"", args.input_pixel_format.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -148,10 +148,14 @@ static void set_vc5_encoder_parameters( vc5_encoder_parameters& vc5_encoder_para
|
|||
case PIXEL_FORMAT_RGGB_12P:
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_RGGB_12P;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RGGB_14:
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_RGGB_14;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RGGB_14:
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_RGGB_14;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RGGB_16:
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_RGGB_16;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_GBRG_12:
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_GBRG_12;
|
||||
|
@ -160,7 +164,15 @@ static void set_vc5_encoder_parameters( vc5_encoder_parameters& vc5_encoder_para
|
|||
case PIXEL_FORMAT_GBRG_12P:
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_GBRG_12P;
|
||||
break;
|
||||
|
||||
|
||||
case PIXEL_FORMAT_GBRG_14:
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_GBRG_14;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_GBRG_16:
|
||||
vc5_encoder_params.pixel_format = VC5_ENCODER_PIXEL_FORMAT_GBRG_16;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -752,6 +764,13 @@ static bool read_dng(const gpr_allocator* allocator,
|
|||
{
|
||||
tuning_info.pixel_format = PIXEL_FORMAT_GBRG_12;
|
||||
}
|
||||
else if (dgain_saturation_level.level_red == 16383 &&
|
||||
dgain_saturation_level.level_green_even == 16383 &&
|
||||
dgain_saturation_level.level_green_odd == 16383 &&
|
||||
dgain_saturation_level.level_blue == 16383)
|
||||
{
|
||||
tuning_info.pixel_format = PIXEL_FORMAT_GBRG_14;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(0);
|
||||
|
@ -1042,14 +1061,26 @@ static void write_dng(const gpr_allocator* allocator,
|
|||
vc5_decoder_params.pixel_format = VC5_DECODER_PIXEL_FORMAT_RGGB_12;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RGGB_14:
|
||||
vc5_decoder_params.pixel_format = VC5_DECODER_PIXEL_FORMAT_RGGB_14;
|
||||
break;
|
||||
case PIXEL_FORMAT_RGGB_14:
|
||||
vc5_decoder_params.pixel_format = VC5_DECODER_PIXEL_FORMAT_RGGB_14;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RGGB_16:
|
||||
vc5_decoder_params.pixel_format = VC5_DECODER_PIXEL_FORMAT_RGGB_16;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_GBRG_12:
|
||||
vc5_decoder_params.pixel_format = VC5_DECODER_PIXEL_FORMAT_GBRG_12;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_GBRG_14:
|
||||
vc5_decoder_params.pixel_format = VC5_DECODER_PIXEL_FORMAT_GBRG_14;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_GBRG_16:
|
||||
vc5_decoder_params.pixel_format = VC5_DECODER_PIXEL_FORMAT_GBRG_16;
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_GBRG_12:
|
||||
vc5_decoder_params.pixel_format = VC5_DECODER_PIXEL_FORMAT_GBRG_12;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return;
|
||||
|
@ -1113,6 +1144,7 @@ static void write_dng(const gpr_allocator* allocator,
|
|||
break;
|
||||
case PIXEL_FORMAT_GBRG_12:
|
||||
case PIXEL_FORMAT_GBRG_12P:
|
||||
case PIXEL_FORMAT_GBRG_14:
|
||||
negative->SetQuadBlacks(static_black_level.g_b_black,
|
||||
static_black_level.b_black,
|
||||
static_black_level.r_black,
|
||||
|
@ -1244,7 +1276,7 @@ static void write_dng(const gpr_allocator* allocator,
|
|||
{
|
||||
negative->SetBayerMosaic(1);
|
||||
}
|
||||
else if( convert_params->tuning_info.pixel_format == PIXEL_FORMAT_GBRG_12 || convert_params->tuning_info.pixel_format == PIXEL_FORMAT_GBRG_12P )
|
||||
else if( convert_params->tuning_info.pixel_format == PIXEL_FORMAT_GBRG_12 || convert_params->tuning_info.pixel_format == PIXEL_FORMAT_GBRG_12P || convert_params->tuning_info.pixel_format == PIXEL_FORMAT_GBRG_14)
|
||||
{
|
||||
negative->SetBayerMosaic(3);
|
||||
}
|
||||
|
@ -1395,7 +1427,8 @@ static void write_dng(const gpr_allocator* allocator,
|
|||
|
||||
jpeg_preview->fInfo.fIsPrimary = true;
|
||||
|
||||
const gpr_rgb_buffer& rgb_buffer = gpr_writer->get_rgb_thumbnail();
|
||||
|
||||
const gpr_rgb_buffer& rgb_buffer = gpr_writer->get_rgb_thumbnail();
|
||||
|
||||
gpr_buffer_auto buffer( allocator->Alloc, allocator->Free );
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ void gpr_read_image::ReadTile (dng_host &host,
|
|||
}
|
||||
else
|
||||
{
|
||||
pixel_format = VC5_DECODER_PIXEL_FORMAT_GBRG_12;
|
||||
pixel_format = VC5_DECODER_PIXEL_FORMAT_GBRG_14;
|
||||
}
|
||||
|
||||
if( DecodeVC5( image, *_vc5_buffer, pixel_format ) )
|
||||
|
|
|
@ -44,13 +44,19 @@
|
|||
{
|
||||
PIXEL_FORMAT_RGGB_12 = 0, // RGGB 12bit pixels packed into 16bits
|
||||
|
||||
PIXEL_FORMAT_RGGB_12P = 1, // RGGB 12bit pixels packed into 12bits
|
||||
|
||||
PIXEL_FORMAT_RGGB_14 = 2, // RGGB 14bit pixels packed into 16bits
|
||||
|
||||
PIXEL_FORMAT_GBRG_12 = 3, // GBRG 12bit pixels packed into 16bits
|
||||
|
||||
PIXEL_FORMAT_GBRG_12P = 4, // GBRG 12bit pixels packed into 12bits
|
||||
PIXEL_FORMAT_RGGB_12P, // RGGB 12bit pixels packed into 12bits
|
||||
|
||||
PIXEL_FORMAT_RGGB_14, // RGGB 14bit pixels packed into 16bits
|
||||
|
||||
PIXEL_FORMAT_RGGB_16, // RGGB 16bit pixels packed into 16bits
|
||||
|
||||
PIXEL_FORMAT_GBRG_12, // GBRG 12bit pixels packed into 16bits
|
||||
|
||||
PIXEL_FORMAT_GBRG_12P, // GBRG 12bit pixels packed into 12bits
|
||||
|
||||
PIXEL_FORMAT_GBRG_14, // GBRG 14bit pixels packed into 16bits
|
||||
|
||||
PIXEL_FORMAT_GBRG_16, // GBRG 16bit pixels packed into 16bits
|
||||
|
||||
} GPR_PIXEL_FORMAT;
|
||||
|
||||
|
|
|
@ -126,10 +126,12 @@ DIMENSION ImagePitch(DIMENSION width, PIXEL_FORMAT format)
|
|||
|
||||
switch (format)
|
||||
{
|
||||
case PIXEL_FORMAT_RAW_RGGB_14:
|
||||
case PIXEL_FORMAT_RAW_GBRG_12:
|
||||
case PIXEL_FORMAT_RAW_GBRG_12P:
|
||||
case PIXEL_FORMAT_RAW_RGGB_12:
|
||||
case PIXEL_FORMAT_RAW_RGGB_14:
|
||||
case PIXEL_FORMAT_RAW_RGGB_16:
|
||||
case PIXEL_FORMAT_RAW_GBRG_12:
|
||||
case PIXEL_FORMAT_RAW_GBRG_14:
|
||||
case PIXEL_FORMAT_RAW_GBRG_16:
|
||||
// Half the width of the image times 2 samples times 2 bytes per sample
|
||||
pitch = width * sizeof(uint16_t);
|
||||
break;
|
||||
|
|
|
@ -62,7 +62,8 @@ typedef enum
|
|||
|
||||
PIXEL_FORMAT_RAW_GBRG_12 = 109,
|
||||
PIXEL_FORMAT_RAW_GBRG_12P = 110,
|
||||
PIXEL_FORMAT_RAW_GBRG_14 = 111,
|
||||
PIXEL_FORMAT_RAW_GBRG_14 = 111,
|
||||
PIXEL_FORMAT_RAW_GBRG_16 = 112,
|
||||
|
||||
PIXEL_FORMAT_RAW_DEFAULT = PIXEL_FORMAT_RAW_RGGB_14,
|
||||
|
||||
|
|
|
@ -872,8 +872,9 @@ CODEC_ERROR ImageRepackingProcess(const UNPACKED_IMAGE *unpacked_image,
|
|||
return PackComponentsToRAW(unpacked_image, output_buffer, output_pitch,
|
||||
output_width, output_height, enabled_parts, 14, output_format );
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RAW_RGGB_16:
|
||||
|
||||
case PIXEL_FORMAT_RAW_RGGB_16:
|
||||
case PIXEL_FORMAT_RAW_GBRG_16:
|
||||
return PackComponentsToRAW(unpacked_image, output_buffer, output_pitch,
|
||||
output_width, output_height, enabled_parts, 16, output_format );
|
||||
break;
|
||||
|
|
|
@ -34,13 +34,17 @@
|
|||
*/
|
||||
typedef enum
|
||||
{
|
||||
VC5_DECODER_PIXEL_FORMAT_RGGB_12 = 0, // RGGB 14bit pixels packed into 16bits
|
||||
VC5_DECODER_PIXEL_FORMAT_RGGB_12 = 0, // RGGB 14bit pixels packed into 16bits
|
||||
|
||||
VC5_DECODER_PIXEL_FORMAT_RGGB_14 = 1, // RGGB 14bit pixels packed into 16bits
|
||||
VC5_DECODER_PIXEL_FORMAT_RGGB_14, // RGGB 14bit pixels packed into 16bits
|
||||
|
||||
VC5_DECODER_PIXEL_FORMAT_RGGB_16, // RGGB 16bit pixels packed into 16bits
|
||||
|
||||
VC5_DECODER_PIXEL_FORMAT_GBRG_12 = 2, // GBRG 12bit pixels packed into 16bits
|
||||
VC5_DECODER_PIXEL_FORMAT_GBRG_12, // GBRG 12bit pixels packed into 16bits
|
||||
|
||||
VC5_DECODER_PIXEL_FORMAT_GBRG_14 = 3, // GBRG 12bit pixels packed into 16bits
|
||||
VC5_DECODER_PIXEL_FORMAT_GBRG_14, // GBRG 14bit pixels packed into 16bits
|
||||
|
||||
VC5_DECODER_PIXEL_FORMAT_GBRG_16, // GBRG 16bit pixels packed into 16bits
|
||||
|
||||
VC5_DECODER_PIXEL_FORMAT_DEFAULT = VC5_DECODER_PIXEL_FORMAT_RGGB_14,
|
||||
|
||||
|
|
|
@ -743,9 +743,11 @@ CODEC_ERROR ImageUnpackingProcess(const PACKED_IMAGE *input,
|
|||
case PIXEL_FORMAT_RAW_RGGB_12:
|
||||
case PIXEL_FORMAT_RAW_RGGB_12P:
|
||||
case PIXEL_FORMAT_RAW_RGGB_14:
|
||||
case PIXEL_FORMAT_RAW_RGGB_16:
|
||||
case PIXEL_FORMAT_RAW_GBRG_12:
|
||||
case PIXEL_FORMAT_RAW_GBRG_12P:
|
||||
case PIXEL_FORMAT_RAW_RGGB_16:
|
||||
case PIXEL_FORMAT_RAW_GBRG_14:
|
||||
case PIXEL_FORMAT_RAW_GBRG_16:
|
||||
channel_count = 4;
|
||||
max_channel_width = input->width / 2;
|
||||
max_channel_height = input->height / 2;
|
||||
|
@ -766,25 +768,30 @@ CODEC_ERROR ImageUnpackingProcess(const PACKED_IMAGE *input,
|
|||
// The configuration of component arrays is determined by the image format
|
||||
switch (input->format)
|
||||
{
|
||||
case PIXEL_FORMAT_RAW_RGGB_14:
|
||||
UnpackImage_14(input, output, enabled_parts, true );
|
||||
|
||||
case PIXEL_FORMAT_RAW_RGGB_12P:
|
||||
UnpackImage_12P(input, output, enabled_parts, true );
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RAW_RGGB_12:
|
||||
UnpackImage_12(input, output, enabled_parts, true );
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RAW_GBRG_12:
|
||||
UnpackImage_12(input, output, enabled_parts, false );
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RAW_RGGB_12P:
|
||||
UnpackImage_12P(input, output, enabled_parts, true );
|
||||
case PIXEL_FORMAT_RAW_RGGB_14:
|
||||
UnpackImage_14(input, output, enabled_parts, true );
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RAW_GBRG_12P:
|
||||
UnpackImage_12P(input, output, enabled_parts, false );
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RAW_GBRG_12:
|
||||
UnpackImage_12(input, output, enabled_parts, false );
|
||||
break;
|
||||
|
||||
case PIXEL_FORMAT_RAW_GBRG_14:
|
||||
UnpackImage_14(input, output, enabled_parts, false);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
|
|
|
@ -102,10 +102,14 @@ CODEC_ERROR vc5_encoder_process(const vc5_encoder_parameters* encoding_paramet
|
|||
case VC5_ENCODER_PIXEL_FORMAT_RGGB_12P:
|
||||
image.format = PIXEL_FORMAT_RAW_RGGB_12P;
|
||||
break;
|
||||
|
||||
case VC5_ENCODER_PIXEL_FORMAT_RGGB_14:
|
||||
image.format = PIXEL_FORMAT_RAW_RGGB_14;
|
||||
break;
|
||||
|
||||
case VC5_ENCODER_PIXEL_FORMAT_RGGB_14:
|
||||
image.format = PIXEL_FORMAT_RAW_RGGB_14;
|
||||
break;
|
||||
|
||||
case VC5_ENCODER_PIXEL_FORMAT_RGGB_16:
|
||||
image.format = PIXEL_FORMAT_RAW_RGGB_16;
|
||||
break;
|
||||
|
||||
case VC5_ENCODER_PIXEL_FORMAT_GBRG_12:
|
||||
image.format = PIXEL_FORMAT_RAW_GBRG_12;
|
||||
|
@ -114,6 +118,15 @@ CODEC_ERROR vc5_encoder_process(const vc5_encoder_parameters* encoding_paramet
|
|||
case VC5_ENCODER_PIXEL_FORMAT_GBRG_12P:
|
||||
image.format = PIXEL_FORMAT_RAW_GBRG_12P;
|
||||
break;
|
||||
|
||||
case VC5_ENCODER_PIXEL_FORMAT_GBRG_14:
|
||||
image.format = PIXEL_FORMAT_RAW_GBRG_14;
|
||||
break;
|
||||
|
||||
case VC5_ENCODER_PIXEL_FORMAT_GBRG_16:
|
||||
image.format = PIXEL_FORMAT_RAW_GBRG_16;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
|
|
|
@ -34,15 +34,21 @@
|
|||
*/
|
||||
typedef enum
|
||||
{
|
||||
VC5_ENCODER_PIXEL_FORMAT_RGGB_12 = 0, // RGGB 14bit pixels packed into 16bits
|
||||
VC5_ENCODER_PIXEL_FORMAT_RGGB_12 = 0, // RGGB 12bit LSB pixels stored into 16bits
|
||||
|
||||
VC5_ENCODER_PIXEL_FORMAT_RGGB_12P = 1, // RGGB 14bit pixels packed into 16bits
|
||||
VC5_ENCODER_PIXEL_FORMAT_RGGB_12P, // RGGB 12bit pixels packed into 12bits
|
||||
|
||||
VC5_ENCODER_PIXEL_FORMAT_RGGB_14 = 2, // RGGB 14bit pixels packed into 16bits
|
||||
VC5_ENCODER_PIXEL_FORMAT_RGGB_14, // RGGB 14bit LSB pixels stored into 16bits
|
||||
|
||||
VC5_ENCODER_PIXEL_FORMAT_RGGB_16, // RGGB 16bit stored into 16bits
|
||||
|
||||
VC5_ENCODER_PIXEL_FORMAT_GBRG_12 = 3, // GBRG 12bit pixels packed into 16bits
|
||||
VC5_ENCODER_PIXEL_FORMAT_GBRG_12, // GBRG 12bit pixels packed into 16bits
|
||||
|
||||
VC5_ENCODER_PIXEL_FORMAT_GBRG_12P = 4, // GBRG 12bit pixels packed into 12bits
|
||||
VC5_ENCODER_PIXEL_FORMAT_GBRG_12P, // GBRG 12bit pixels packed into 12bits
|
||||
|
||||
VC5_ENCODER_PIXEL_FORMAT_GBRG_14, // GBRG 14bit LSB pixels stored into 16bits
|
||||
|
||||
VC5_ENCODER_PIXEL_FORMAT_GBRG_16, // GBRG 16bit stored into 16bits
|
||||
|
||||
VC5_ENCODER_PIXEL_FORMAT_DEFAULT = VC5_ENCODER_PIXEL_FORMAT_RGGB_14,
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue