|
14 | 14 |
|
15 | 15 | using namespace libpisp; |
16 | 16 |
|
17 | | -namespace |
18 | | -{ |
19 | | - |
20 | | -struct config_param |
21 | | -{ |
22 | | - uint32_t dirty_flags_bayer; |
23 | | - uint32_t dirty_flags_rgb; |
24 | | - uint32_t dirty_flags_extra; |
25 | | - std::size_t offset; |
26 | | - std::size_t size; |
27 | | -}; |
28 | | - |
29 | | -const config_param config_map[] = { |
30 | | - // *_dirty_flag_extra types |
31 | | - { 0, 0, PISP_BE_DIRTY_GLOBAL, offsetof(pisp_be_config, global), sizeof(pisp_be_global_config) }, |
32 | | - { 0, 0, PISP_BE_DIRTY_SH_FC_COMBINE, offsetof(pisp_be_config, sh_fc_combine), sizeof(pisp_be_sh_fc_combine_config) }, |
33 | | - { 0, 0, PISP_BE_DIRTY_CROP, offsetof(pisp_be_config, crop), sizeof(pisp_be_crop_config) }, |
34 | | - |
35 | | - // *_dirty_flags_bayer types |
36 | | - { PISP_BE_BAYER_ENABLE_DECOMPRESS, 0, 0, offsetof(pisp_be_config, decompress), sizeof(pisp_decompress_config) }, |
37 | | - { PISP_BE_BAYER_ENABLE_DPC, 0, 0, offsetof(pisp_be_config, dpc), sizeof(pisp_be_dpc_config) }, |
38 | | - { PISP_BE_BAYER_ENABLE_GEQ, 0, 0, offsetof(pisp_be_config, geq), sizeof(pisp_be_geq_config) }, |
39 | | - { PISP_BE_BAYER_ENABLE_TDN_INPUT, 0, 0, offsetof(pisp_be_config, tdn_input_format), sizeof(pisp_image_format_config) }, |
40 | | - { PISP_BE_BAYER_ENABLE_TDN_DECOMPRESS, 0, 0, offsetof(pisp_be_config, tdn_decompress), sizeof(pisp_decompress_config) }, |
41 | | - { PISP_BE_BAYER_ENABLE_TDN, 0, 0, offsetof(pisp_be_config, tdn), sizeof(pisp_be_tdn_config) }, |
42 | | - { PISP_BE_BAYER_ENABLE_TDN_COMPRESS, 0, 0, offsetof(pisp_be_config, tdn_compress), sizeof(pisp_compress_config) }, |
43 | | - { PISP_BE_BAYER_ENABLE_TDN_OUTPUT, 0, 0, offsetof(pisp_be_config, tdn_output_format), sizeof(pisp_image_format_config) }, |
44 | | - { PISP_BE_BAYER_ENABLE_SDN, 0, 0, offsetof(pisp_be_config, sdn), sizeof(pisp_be_sdn_config) }, |
45 | | - { PISP_BE_BAYER_ENABLE_BLC, 0, 0, offsetof(pisp_be_config, blc), sizeof(pisp_bla_config) }, |
46 | | - { PISP_BE_BAYER_ENABLE_STITCH_COMPRESS, 0, 0, offsetof(pisp_be_config, stitch_compress), sizeof(pisp_compress_config) }, |
47 | | - { PISP_BE_BAYER_ENABLE_STITCH_OUTPUT, 0, 0, offsetof(pisp_be_config, stitch_output_format), sizeof(pisp_image_format_config) }, |
48 | | - { PISP_BE_BAYER_ENABLE_STITCH_INPUT, 0, 0, offsetof(pisp_be_config, stitch_input_format), sizeof(pisp_image_format_config) }, |
49 | | - { PISP_BE_BAYER_ENABLE_STITCH_DECOMPRESS, 0, 0, offsetof(pisp_be_config, stitch_decompress), sizeof(pisp_decompress_config) }, |
50 | | - { PISP_BE_BAYER_ENABLE_STITCH, 0, 0, offsetof(pisp_be_config, stitch), sizeof(pisp_be_stitch_config) }, |
51 | | - { PISP_BE_BAYER_ENABLE_LSC, 0, 0, offsetof(pisp_be_config, lsc), sizeof(pisp_be_lsc_config) }, |
52 | | - { PISP_BE_BAYER_ENABLE_WBG, 0, 0, offsetof(pisp_be_config, wbg), sizeof(pisp_wbg_config) }, |
53 | | - { PISP_BE_BAYER_ENABLE_CDN, 0, 0, offsetof(pisp_be_config, cdn), sizeof(pisp_be_cdn_config) }, |
54 | | - { PISP_BE_BAYER_ENABLE_CAC, 0, 0, offsetof(pisp_be_config, cac), sizeof(pisp_be_cac_config) }, |
55 | | - { PISP_BE_BAYER_ENABLE_DEBIN, 0, 0, offsetof(pisp_be_config, debin), sizeof(pisp_be_debin_config) }, |
56 | | - { PISP_BE_BAYER_ENABLE_TONEMAP, 0, 0, offsetof(pisp_be_config, tonemap), sizeof(pisp_be_tonemap_config) }, |
57 | | - { PISP_BE_BAYER_ENABLE_DEMOSAIC, 0, 0, offsetof(pisp_be_config, demosaic), sizeof(pisp_be_demosaic_config) }, |
58 | | - |
59 | | - // *_dirty_flags_rgb types |
60 | | - { PISP_BE_RGB_ENABLE_CCM, 0, 0, offsetof(pisp_be_config, ccm), sizeof(pisp_be_ccm_config) }, |
61 | | - { PISP_BE_RGB_ENABLE_SAT_CONTROL, 0, 0, offsetof(pisp_be_config, sat_control), sizeof(pisp_be_sat_control_config) }, |
62 | | - { PISP_BE_RGB_ENABLE_YCBCR, 0, 0, offsetof(pisp_be_config, ycbcr), sizeof(pisp_be_ccm_config) }, |
63 | | - { PISP_BE_RGB_ENABLE_SHARPEN, 0, 0, offsetof(pisp_be_config, sharpen), sizeof(pisp_be_sharpen_config) }, |
64 | | - { PISP_BE_RGB_ENABLE_FALSE_COLOUR, 0, 0, offsetof(pisp_be_config, false_colour), sizeof(pisp_be_false_colour_config) }, |
65 | | - { PISP_BE_RGB_ENABLE_YCBCR_INVERSE, 0, 0, offsetof(pisp_be_config, ycbcr_inverse), sizeof(pisp_be_ccm_config) }, |
66 | | - { PISP_BE_RGB_ENABLE_GAMMA, 0, 0, offsetof(pisp_be_config, gamma), sizeof(pisp_be_gamma_config) }, |
67 | | - // Output 0 |
68 | | - { PISP_BE_RGB_ENABLE_CSC0, 0, 0, offsetof(pisp_be_config, csc), sizeof(pisp_be_ccm_config) }, |
69 | | - { PISP_BE_RGB_ENABLE_DOWNSCALE0, 0, 0, offsetof(pisp_be_config, downscale), sizeof(pisp_be_downscale_config) }, |
70 | | - { PISP_BE_RGB_ENABLE_RESAMPLE0, 0, 0, offsetof(pisp_be_config, resample), sizeof(pisp_be_resample_config) }, |
71 | | - { PISP_BE_RGB_ENABLE_OUTPUT0, 0, 0, offsetof(pisp_be_config, output_format), sizeof(pisp_be_output_format_config) }, |
72 | | - { PISP_BE_RGB_ENABLE_HOG, 0, 0, offsetof(pisp_be_config, hog), sizeof(pisp_be_hog_config) }, |
73 | | - // Output 1 |
74 | | - { PISP_BE_RGB_ENABLE_CSC1, 0, 0, offsetof(pisp_be_config, csc) + sizeof(pisp_be_ccm_config), sizeof(pisp_be_ccm_config) }, |
75 | | - { PISP_BE_RGB_ENABLE_DOWNSCALE1, 0, 0, offsetof(pisp_be_config, downscale) + sizeof(pisp_be_downscale_config), sizeof(pisp_be_downscale_config) }, |
76 | | - { PISP_BE_RGB_ENABLE_RESAMPLE1, 0, 0, offsetof(pisp_be_config, resample) + sizeof(pisp_be_resample_config), sizeof(pisp_be_resample_config) }, |
77 | | - { PISP_BE_RGB_ENABLE_OUTPUT1, 0, 0, offsetof(pisp_be_config, output_format) + sizeof(pisp_be_output_format_config), sizeof(pisp_be_output_format_config) }, |
78 | | -}; |
79 | | - |
80 | | -} // namespace |
81 | | - |
82 | 17 | BackEnd::BackEnd(Config const &config, PiSPVariant const &variant) |
83 | 18 | : config_(config), variant_(variant), retile_(true), finalise_tiling_(true) |
84 | 19 | { |
@@ -475,26 +410,6 @@ void BackEnd::GetOutputFormat(unsigned int i, pisp_be_output_format_config &outp |
475 | 410 | output_format = be_config_.output_format[i]; |
476 | 411 | } |
477 | 412 |
|
478 | | -void BackEnd::MergeConfig(const pisp_be_config &config) |
479 | | -{ |
480 | | - for (auto const ¶m : config_map) |
481 | | - { |
482 | | - if ((param.dirty_flags_bayer & config.dirty_flags_bayer) || (param.dirty_flags_rgb & config.dirty_flags_rgb) || |
483 | | - (param.dirty_flags_extra & config.dirty_flags_extra)) |
484 | | - { |
485 | | - const uint8_t *src = reinterpret_cast<const uint8_t *>(&config) + param.offset; |
486 | | - uint8_t *dest = reinterpret_cast<uint8_t *>(&be_config_) + param.offset; |
487 | | - |
488 | | - memcpy(dest, src, param.size); |
489 | | - be_config_.dirty_flags_bayer |= param.dirty_flags_bayer; |
490 | | - be_config_.dirty_flags_rgb |= param.dirty_flags_rgb; |
491 | | - be_config_.dirty_flags_extra |= param.dirty_flags_extra; |
492 | | - // Force a retile for now. This could become more granular. |
493 | | - retile_ = true; |
494 | | - } |
495 | | - } |
496 | | -} |
497 | | - |
498 | 413 | void BackEnd::SetSmartResize(unsigned int i, BackEnd::SmartResize const &smart_resize) |
499 | 414 | { |
500 | 415 | PISP_ASSERT(i < variant_.BackEndNumBranches(0)); |
|
0 commit comments