Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presteps needed by image_decoder.h APIs #4277

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

jantonguirao
Copy link
Contributor

Signed-off-by: Joaquin Anton janton@nvidia.com

Category:

Refactoring

Description:

  • This PR is meant to alleviate the complexity of a larger PR (Image decoder #4224), by extracting some refactoring out of it.

Additional information:

Affected modules and functionalities:

imgcodec

Key points relevant for the review:

NA

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [5992476]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [5992476]: BUILD PASSED

} catch (...) {
res.exception = std::current_exception();
res.success = false;
auto decoded_image = jpeg::Uncompress(encoded_data, data_size, flags);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed try/catch (handled one layer up)

res.intermediate_buffer.resize(volume(ctx.shape) * type_size);
decode_out = {res.intermediate_buffer.data(), ctx.shape, ctx.pixel_type};
}
auto decode_out = out;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed try/catch (handled one layer up)

@jantonguirao jantonguirao assigned szalpal and unassigned stiepan and szalpal Sep 26, 2022
Copy link
Member

@szalpal szalpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is that when a try/catch is removed, there is a short period between the merges of PRs, that this error is not handled properly. Please consider this.

@jantonguirao
Copy link
Contributor Author

My concern is that when a try/catch is removed, there is a short period between the merges of PRs, that this error is not handled properly. Please consider this.

The other try/catch is already in place. This one is redundant at this point.

@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6012177]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6012177]: BUILD FAILED

@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6012360]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6012360]: BUILD FAILED

result.exception = std::current_exception();
if (is_processing_needed) {
auto multiplier = calc_bpp_adjustment_multiplier(ctx.bpp, ctx.pixel_type);
Convert(out, "HWC", opts.format, decode_out, "CHW", format, ctx.cuda_stream, {}, multiplier);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outdated?

Signed-off-by: Joaquin Anton <janton@nvidia.com>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6013162]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6013162]: BUILD PASSED

@mzient mzient merged commit 950f6b2 into NVIDIA:main Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants