Skip to content

Commit

Permalink
Fix up-scaling bit depth
Browse files Browse the repository at this point in the history
Fixes #609
  • Loading branch information
mayeut committed Sep 29, 2015
1 parent c59f464 commit cf352af
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/bin/jp2/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static void scale_component_up(opj_image_comp_t* component, OPJ_UINT32 precision
}
}
component->prec = precision;
component->bpp = precision;
}
void scale_component(opj_image_comp_t* component, OPJ_UINT32 precision)
{
Expand Down

5 comments on commit cf352af

@boxerab
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like component->prec and component->bpp are always equal in the code. Is this always true?

@mayeut
Copy link
Collaborator Author

@mayeut mayeut commented on cf352af Sep 29, 2015

Choose a reason for hiding this comment

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

It seems that bpp is only used in the library for the Cinema Profile warning (I guess the images components where in fact 12bits in the resulting jp2 file when you filed #609 ...)
The rest of the code in openjp2 uses prec (or so it seems doing a search on the project)
I don't know why the 2 co-exist... maybe @detonin have some insight on this. Documentation doesn't help.

@boxerab
Copy link
Contributor

Choose a reason for hiding this comment

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

Confusing - perhaps bpp should be removed

@detonin
Copy link
Contributor

Choose a reason for hiding this comment

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

I already noticed that bpp and prec were overlapping but do not have insight and the reason behind this.
I'm the author of the Cinema Profile warning and I remember I did not know whether to use bppor prec. So if it's indeed the only place where it's used independently from prec, I would replace with prec and completely remove bpp (there are plenty of occurences in the convert files btw).

Btw, prec is probably a better syntax than bpp as the latter stands for "bits per pixel", which is actually not the case (it corresponds to "bits per sample", having one sample per component).

@boxerab
Copy link
Contributor

@boxerab boxerab commented on cf352af Oct 1, 2015

Choose a reason for hiding this comment

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

Yes, I vote to remove it.

Please sign in to comment.