In convert.c, corrected imagetobmp() conversion for grayscale. In tcd.c, corrected Rate modification in tcd_init_encode().
This commit is contained in:
parent
e21d865440
commit
29ea3dde47
|
@ -5,6 +5,10 @@ What's New for OpenJPEG
|
||||||
! : changed
|
! : changed
|
||||||
+ : added
|
+ : added
|
||||||
|
|
||||||
|
February 5, 2008
|
||||||
|
! [Parvatha] In convert.c, corrected imagetobmp() conversion for grayscale. In tcd.c, corrected Rate modification in
|
||||||
|
tcd_init_encode(). Thanks to Jeremy Furtek and Jérôme Fimes.
|
||||||
|
|
||||||
January 31, 2008
|
January 31, 2008
|
||||||
! [GB] In opjviewer, unification of JPEG 2000 family handlers (*.jp2, *.mj2, *.j2k) in a single file
|
! [GB] In opjviewer, unification of JPEG 2000 family handlers (*.jp2, *.mj2, *.j2k) in a single file
|
||||||
|
|
||||||
|
|
|
@ -914,7 +914,8 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
|
||||||
if (image->comps[0].prec > 8) {
|
if (image->comps[0].prec > 8) {
|
||||||
adjustR = image->comps[0].prec - 8;
|
adjustR = image->comps[0].prec - 8;
|
||||||
printf("BMP CONVERSION: Truncating component 0 from %d bits to 8 bits\n", image->comps[0].prec);
|
printf("BMP CONVERSION: Truncating component 0 from %d bits to 8 bits\n", image->comps[0].prec);
|
||||||
}
|
}else
|
||||||
|
adjustR = 0;
|
||||||
|
|
||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
fprintf(fdest, "%c%c%c%c", i, i, i, 0);
|
fprintf(fdest, "%c%c%c%c", i, i, i, 0);
|
||||||
|
|
|
@ -418,12 +418,19 @@ void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int cur
|
||||||
/* Modification of the RATE >> */
|
/* Modification of the RATE >> */
|
||||||
for (j = 0; j < tcp->numlayers; j++) {
|
for (j = 0; j < tcp->numlayers; j++) {
|
||||||
tcp->rates[j] = tcp->rates[j] ?
|
tcp->rates[j] = tcp->rates[j] ?
|
||||||
((float) (tile->numcomps
|
cp->tp_on ?
|
||||||
* (tile->x1 - tile->x0)
|
(((float) (tile->numcomps
|
||||||
* (tile->y1 - tile->y0)
|
* (tile->x1 - tile->x0)
|
||||||
* image->comps[0].prec))/
|
* (tile->y1 - tile->y0)
|
||||||
(tcp->rates[j] * 8 * image->comps[0].dx * image->comps[0].dy)
|
* image->comps[0].prec))
|
||||||
: 0;
|
/(tcp->rates[j] * 8 * image->comps[0].dx * image->comps[0].dy)) - (((tcd->cur_totnum_tp - 1) * 14 )/ tcp->numlayers)
|
||||||
|
:
|
||||||
|
((float) (tile->numcomps
|
||||||
|
* (tile->x1 - tile->x0)
|
||||||
|
* (tile->y1 - tile->y0)
|
||||||
|
* image->comps[0].prec))/
|
||||||
|
(tcp->rates[j] * 8 * image->comps[0].dx * image->comps[0].dy)
|
||||||
|
: 0;
|
||||||
|
|
||||||
if (tcp->rates[j]) {
|
if (tcp->rates[j]) {
|
||||||
if (j && tcp->rates[j] < tcp->rates[j - 1] + 10) {
|
if (j && tcp->rates[j] < tcp->rates[j - 1] + 10) {
|
||||||
|
|
Loading…
Reference in New Issue