sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
strncpy(parameters->infile, infilename, sizeof(infilename));
- /* Set output file */
+ /*Set output file*/
strcpy(temp_ofname,strtok(image_filename,"."));
while((temp_p = strtok(NULL,".")) != NULL){
strcat(temp_ofname,temp1);
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
if(dirptr){
- dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names */
+ dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names*/
dirptr->filename = (char**) malloc(num_images*sizeof(char*));
if(!dirptr->filename_buf){
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
strncpy(parameters->infile, infilename, sizeof(infilename));
- //Set output file
+ /*Set output file*/
strcpy(temp_ofname,strtok(image_filename,"."));
while((temp_p = strtok(NULL,".")) != NULL){
strcat(temp_ofname,temp1);
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
if(dirptr){
- dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names */
+ dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names*/
dirptr->filename = (char**) malloc(num_images*sizeof(char*));
if(!dirptr->filename_buf){
}
return EXIT_SUCCESS;
}
-//end main
+/*end main*/
int cas ;
} v4dwt_t ;
-static const float dwt_alpha = 1.586134342f; // 12994
-static const float dwt_beta = 0.052980118f; // 434
-static const float dwt_gamma = -0.882911075f; // -7233
-static const float dwt_delta = -0.443506852f; // -3633
+static const float dwt_alpha = 1.586134342f; /* 12994 */
+static const float dwt_beta = 0.052980118f; /* 434 */
+static const float dwt_gamma = -0.882911075f; /* -7233 */
+static const float dwt_delta = -0.443506852f; /* -3633 */
-static const float K = 1.230174105f; // 10078
+static const float K = 1.230174105f; /* 10078 */
/* FIXME: What is this constant? */
static const float c13318 = 1.625732422f;
# define INDEXBOX_MANAGER_H_
#include "openjpeg.h"
-#include "j2k.h" // needed to use jp2.h
+#include "j2k.h" /* needed to use jp2.h */
#include "jp2.h"
#define JPIP_CIDX 0x63696478 /* Codestream index */
tccp->numresolutions = cio_read(cio, 1) + 1; /* SPcox (D) */
- // If user wants to remove more resolutions than the codestream contains, return error
+ /* If user wants to remove more resolutions than the codestream contains, return error*/
if (cp->reduce >= tccp->numresolutions) {
opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number "
"of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno);
if (numparts)
j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_realloc(j2k->cstr_info->tile[tileno].tp, numparts * sizeof(opj_tp_info_t));
else
- j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_realloc(j2k->cstr_info->tile[tileno].tp, 10 * sizeof(opj_tp_info_t)); // Fixme (10)
+ j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_realloc(j2k->cstr_info->tile[tileno].tp, 10 * sizeof(opj_tp_info_t)); /* Fixme (10)*/
j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos = cio_tell(cio) - 12;
j2k->cstr_info->tile[tileno].tp[partno].tp_end_pos =
j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos + totlen - 1;
return 0;
}
e = j2k_dec_mstab_lookup(id);
- // Check if the marker is known
+ /* Check if the marker is known*/
if (!(j2k->state & e->states)) {
opj_image_destroy(image);
opj_event_msg(cinfo, EVT_ERROR, "%.8x: unexpected marker %x\n", cio_tell(cio) - 2, id);
return 0;
}
- // Check if the decoding is limited to the main header
+ /* Check if the decoding is limited to the main header*/
if (e->id == J2K_MS_SOT && j2k->cp->limit_decoding == LIMIT_TO_MAIN_HEADER) {
opj_event_msg(cinfo, EVT_INFO, "Main Header decoded.\n");
return image;
if(parameters->cp_cinema)
{
- //Precinct size for lowest frequency subband=128
+ /*Precinct size for lowest frequency subband=128*/
tccp->prcw[0] = 7;
tccp->prch[0] = 7;
- //Precinct size at all other resolutions = 256
+ /*Precinct size at all other resolutions = 256*/
for (j = 1; j < tccp->numresolutions; j++) {
tccp->prcw[j] = 8;
tccp->prch[j] = 8;
}
p++;
/*printf("\nsize precinct for level %d : %d,%d\n", j,tccp->prcw[j], tccp->prch[j]); */
- } //end for
+ } /*end for*/
} else {
for (j = 0; j < tccp->numresolutions; j++) {
tccp->prcw[j] = 15;
int write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
{
- int len, lenp, tileno, version, i, nmax, size_of_coding; // 4 or 8
+ int len, lenp, tileno, version, i, nmax, size_of_coding; /* 4 or 8 */
opj_tile_info_t *tile_Idx;
opj_packet_info_t packet;
int resno, precno, layno, num_packet;
int len, lenp, compno, i;
opj_jp2_box_t *box;
- // printf("cstr_info.packno %d\n", cstr_info.packno); //NMAX?
+ /* printf("cstr_info.packno %d\n", cstr_info.packno); //NMAX? */
box = (opj_jp2_box_t *)opj_calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t));
int write_ppixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
{
- int len, lenp, tileno, version, i, nmax, size_of_coding; // 4 or 8
+ int len, lenp, tileno, version, i, nmax, size_of_coding; /* 4 or 8*/
opj_tile_info_t *tile_Idx;
opj_packet_info_t packet;
int resno, precno, layno, num_packet;
/* </EPH> */
/* << INDEX */
- // End of packet header position. Currently only represents the distance to start of packet
- // Will be updated later by incrementing with packet start value
+ /* End of packet header position. Currently only represents the distance to start of packet
+ // Will be updated later by incrementing with packet start value */
if(cstr_info && cstr_info->index_write) {
opj_packet_info_t *info_PK = &cstr_info->tile[tileno].packet[cstr_info->packno];
info_PK->end_ph_pos = (int)(c - dest);
}
/* << INDEX */
- // End of packet header position. Currently only represents the distance to start of packet
- // Will be updated later by incrementing with packet start value
+ /* End of packet header position. Currently only represents the distance to start of packet
+ // Will be updated later by incrementing with packet start value*/
if(pack_info) {
pack_info->end_ph_pos = (int)(c - src);
}
}
/* << INDEX */
- // End of packet header position. Currently only represents the distance to start of packet
- // Will be updated later by incrementing with packet start value
+ /* End of packet header position. Currently only represents the distance to start of packet
+ // Will be updated later by incrementing with packet start value*/
if(pack_info) {
pack_info->end_ph_pos = (int)(hd - src);
}
info_PK->start_pos = ((cp->tp_on | tcp->POC)&& info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno - 1].end_pos + 1;
}
info_PK->end_pos = info_PK->start_pos + e - 1;
- info_PK->end_ph_pos += info_PK->start_pos - 1; // End of packet header which now only represents the distance
- // to start of packet is incremented by value of start of packet
+ info_PK->end_ph_pos += info_PK->start_pos - 1; /* End of packet header which now only represents the distance
+ // to start of packet is incremented by value of start of packet*/
}
cstr_info->packno++;
opj_packet_info_t *info_PK = &info_TL->packet[cstr_info->packno];
if (!cstr_info->packno) {
info_PK->start_pos = info_TL->end_header + 1;
- } else if (info_TL->packet[cstr_info->packno-1].end_pos >= (int)cstr_info->tile[tileno].tp[curtp].tp_end_pos){ // New tile part
- info_TL->tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; // Number of packets in previous tile-part
+ } else if (info_TL->packet[cstr_info->packno-1].end_pos >= (int)cstr_info->tile[tileno].tp[curtp].tp_end_pos){ /* New tile part*/
+ info_TL->tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; /* Number of packets in previous tile-part*/
info_TL->tp[curtp].tp_start_pack = tp_start_packno;
tp_start_packno = cstr_info->packno;
curtp++;
info_PK->start_pos = (cp->tp_on && info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno - 1].end_pos + 1;
}
info_PK->end_pos = info_PK->start_pos + e - 1;
- info_PK->end_ph_pos += info_PK->start_pos - 1; // End of packet header which now only represents the distance
- // to start of packet is incremented by value of start of packet
+ info_PK->end_ph_pos += info_PK->start_pos - 1; /* End of packet header which now only represents the distance
+ // to start of packet is incremented by value of start of packet*/
cstr_info->packno++;
}
/* << INDEX */
}
/* INDEX >> */
if(cstr_info) {
- cstr_info->tile[tileno].tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; // Number of packets in last tile-part
+ cstr_info->tile[tileno].tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; /* Number of packets in last tile-part*/
cstr_info->tile[tileno].tp[curtp].tp_start_pack = tp_start_packno;
}
/* << INDEX */
#include "opj_includes.h"
void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t * img) {
- int tileno, compno, resno, bandno, precno;//, cblkno;
+ int tileno, compno, resno, bandno, precno;/*, cblkno;*/
fprintf(fd, "image {\n");
fprintf(fd, " tw=%d, th=%d x0=%d x1=%d y0=%d y1=%d\n",
cio_write( cio, marker[i].len, 2);
}
- // free( marker);
+ /* free( marker);*/
len = cio_tell( cio) - lenp;
cio_seek( cio, lenp);
int i, j;
int Aux;
int num_max_tile_parts;
- int size_of_coding; // 4 or 8
+ int size_of_coding; /* 4 or 8 */
opj_tp_info_t tp;
int version;
Aux = j + 1;
cio_write( cio, Aux,4);
- //cio_write(img.tile[i].tile_parts[j].num_reso_AUX,4); /* Aux_i,j : Auxiliary value */
- // fprintf(stderr,"AUX value %d\n",Aux);
+ /*cio_write(img.tile[i].tile_parts[j].num_reso_AUX,4);*/ /* Aux_i,j : Auxiliary value */
+ /* fprintf(stderr,"AUX value %d\n",Aux);*/
}
- //cio_write(0,4);
+ /*cio_write(0,4);*/
}
/* PADDING */
while (j < num_max_tile_parts){