~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to extern/libopenjpeg/pi.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
@param pi packet iterator to modify
44
44
@return returns false if pi pointed to the last packet or else returns true 
45
45
*/
46
 
static bool pi_next_lrcp(opj_pi_iterator_t * pi);
 
46
static opj_bool pi_next_lrcp(opj_pi_iterator_t * pi);
47
47
/**
48
48
Get next packet in resolution-layer-component-precinct order.
49
49
@param pi packet iterator to modify
50
50
@return returns false if pi pointed to the last packet or else returns true 
51
51
*/
52
 
static bool pi_next_rlcp(opj_pi_iterator_t * pi);
 
52
static opj_bool pi_next_rlcp(opj_pi_iterator_t * pi);
53
53
/**
54
54
Get next packet in resolution-precinct-component-layer order.
55
55
@param pi packet iterator to modify
56
56
@return returns false if pi pointed to the last packet or else returns true 
57
57
*/
58
 
static bool pi_next_rpcl(opj_pi_iterator_t * pi);
 
58
static opj_bool pi_next_rpcl(opj_pi_iterator_t * pi);
59
59
/**
60
60
Get next packet in precinct-component-resolution-layer order.
61
61
@param pi packet iterator to modify
62
62
@return returns false if pi pointed to the last packet or else returns true 
63
63
*/
64
 
static bool pi_next_pcrl(opj_pi_iterator_t * pi);
 
64
static opj_bool pi_next_pcrl(opj_pi_iterator_t * pi);
65
65
/**
66
66
Get next packet in component-precinct-resolution-layer order.
67
67
@param pi packet iterator to modify
68
68
@return returns false if pi pointed to the last packet or else returns true 
69
69
*/
70
 
static bool pi_next_cprl(opj_pi_iterator_t * pi);
 
70
static opj_bool pi_next_cprl(opj_pi_iterator_t * pi);
71
71
 
72
72
/*@}*/
73
73
 
79
79
==========================================================
80
80
*/
81
81
 
82
 
static bool pi_next_lrcp(opj_pi_iterator_t * pi) {
 
82
static opj_bool pi_next_lrcp(opj_pi_iterator_t * pi) {
83
83
        opj_pi_comp_t *comp = NULL;
84
84
        opj_pi_resolution_t *res = NULL;
85
85
        long index = 0;
108
108
                                        index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
109
109
                                        if (!pi->include[index]) {
110
110
                                                pi->include[index] = 1;
111
 
                                                return true;
 
111
                                                return OPJ_TRUE;
112
112
                                        }
113
113
LABEL_SKIP:;
114
114
                                }
116
116
                }
117
117
        }
118
118
        
119
 
        return false;
 
119
        return OPJ_FALSE;
120
120
}
121
121
 
122
 
static bool pi_next_rlcp(opj_pi_iterator_t * pi) {
 
122
static opj_bool pi_next_rlcp(opj_pi_iterator_t * pi) {
123
123
        opj_pi_comp_t *comp = NULL;
124
124
        opj_pi_resolution_t *res = NULL;
125
125
        long index = 0;
147
147
                                        index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
148
148
                                        if (!pi->include[index]) {
149
149
                                                pi->include[index] = 1;
150
 
                                                return true;
 
150
                                                return OPJ_TRUE;
151
151
                                        }
152
152
LABEL_SKIP:;
153
153
                                }
155
155
                }
156
156
        }
157
157
        
158
 
        return false;
 
158
        return OPJ_FALSE;
159
159
}
160
160
 
161
 
static bool pi_next_rpcl(opj_pi_iterator_t * pi) {
 
161
static opj_bool pi_next_rpcl(opj_pi_iterator_t * pi) {
162
162
        opj_pi_comp_t *comp = NULL;
163
163
        opj_pi_resolution_t *res = NULL;
164
164
        long index = 0;
209
209
                                        try1 = int_ceildiv(pi->ty1, comp->dy << levelno);
210
210
                                        rpx = res->pdx + levelno;
211
211
                                        rpy = res->pdy + levelno;
212
 
                                        if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpx))))){
 
212
                                        if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
213
213
                                                continue;       
214
214
                                        }
215
215
                                        if (!((pi->x % (comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
216
216
                                                continue; 
217
217
                                        }
218
218
                                        
219
 
                                        if ((res->pw==0)||(res->pw==0)) continue;
 
219
                                        if ((res->pw==0)||(res->ph==0)) continue;
220
220
                                        
221
221
                                        if ((trx0==trx1)||(try0==try1)) continue;
222
222
                                        
229
229
                                                index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
230
230
                                                if (!pi->include[index]) {
231
231
                                                        pi->include[index] = 1;
232
 
                                                        return true;
 
232
                                                        return OPJ_TRUE;
233
233
                                                }
234
234
LABEL_SKIP:;
235
235
                                        }
238
238
                }
239
239
        }
240
240
        
241
 
        return false;
 
241
        return OPJ_FALSE;
242
242
}
243
243
 
244
 
static bool pi_next_pcrl(opj_pi_iterator_t * pi) {
 
244
static opj_bool pi_next_pcrl(opj_pi_iterator_t * pi) {
245
245
        opj_pi_comp_t *comp = NULL;
246
246
        opj_pi_resolution_t *res = NULL;
247
247
        long index = 0;
290
290
                                        try1 = int_ceildiv(pi->ty1, comp->dy << levelno);
291
291
                                        rpx = res->pdx + levelno;
292
292
                                        rpy = res->pdy + levelno;
293
 
                                        if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpx))))){
 
293
                                        if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
294
294
                                                continue;       
295
295
                                        }
296
296
                                        if (!((pi->x % (comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
297
297
                                                continue; 
298
298
                                        }
299
299
                                        
300
 
                                        if ((res->pw==0)||(res->pw==0)) continue;
 
300
                                        if ((res->pw==0)||(res->ph==0)) continue;
301
301
                                        
302
302
                                        if ((trx0==trx1)||(try0==try1)) continue;
303
303
                                        
310
310
                                                index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
311
311
                                                if (!pi->include[index]) {
312
312
                                                        pi->include[index] = 1;
313
 
                                                        return true;
 
313
                                                        return OPJ_TRUE;
314
314
                                                }       
315
315
LABEL_SKIP:;
316
316
                                        }
319
319
                }
320
320
        }
321
321
        
322
 
        return false;
 
322
        return OPJ_FALSE;
323
323
}
324
324
 
325
 
static bool pi_next_cprl(opj_pi_iterator_t * pi) {
 
325
static opj_bool pi_next_cprl(opj_pi_iterator_t * pi) {
326
326
        opj_pi_comp_t *comp = NULL;
327
327
        opj_pi_resolution_t *res = NULL;
328
328
        long index = 0;
369
369
                                        try1 = int_ceildiv(pi->ty1, comp->dy << levelno);
370
370
                                        rpx = res->pdx + levelno;
371
371
                                        rpy = res->pdy + levelno;
372
 
                                        if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpx))))){
 
372
                                        if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
373
373
                                                continue;       
374
374
                                        }
375
375
                                        if (!((pi->x % (comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
376
376
                                                continue; 
377
377
                                        }
378
378
                                        
379
 
                                        if ((res->pw==0)||(res->pw==0)) continue;
 
379
                                        if ((res->pw==0)||(res->ph==0)) continue;
380
380
                                        
381
381
                                        if ((trx0==trx1)||(try0==try1)) continue;
382
382
                                        
389
389
                                                index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
390
390
                                                if (!pi->include[index]) {
391
391
                                                        pi->include[index] = 1;
392
 
                                                        return true;
 
392
                                                        return OPJ_TRUE;
393
393
                                                }
394
394
LABEL_SKIP:;
395
395
                                        }
398
398
                }
399
399
        }
400
400
        
401
 
        return false;
 
401
        return OPJ_FALSE;
402
402
}
403
403
 
404
404
/* 
707
707
        }
708
708
}
709
709
 
710
 
bool pi_next(opj_pi_iterator_t * pi) {
 
710
opj_bool pi_next(opj_pi_iterator_t * pi) {
711
711
        switch (pi->poc.prg) {
712
712
                case LRCP:
713
713
                        return pi_next_lrcp(pi);
720
720
                case CPRL:
721
721
                        return pi_next_cprl(pi);
722
722
                case PROG_UNKNOWN:
723
 
                        return false;
 
723
                        return OPJ_FALSE;
724
724
        }
725
725
        
726
 
        return false;
 
726
        return OPJ_FALSE;
727
727
}
728
728
 
729
 
bool pi_create_encode( opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos, J2K_T2_MODE t2_mode,int cur_totnum_tp){
 
729
opj_bool pi_create_encode( opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos, J2K_T2_MODE t2_mode,int cur_totnum_tp){
730
730
        char prog[4];
731
731
        int i;
732
732
        int incr_top=1,resetX=0;
748
748
                case RPCL: strncpy(prog, "RPCL",4);
749
749
                        break;
750
750
                case PROG_UNKNOWN: 
751
 
                        return true;
 
751
                        return OPJ_TRUE;
752
752
        }
753
753
 
754
754
        if(!(cp->tp_on && ((!cp->cinema && (t2_mode == FINAL_PASS)) || cp->cinema))){
958
958
                        } 
959
959
                }
960
960
        }       
961
 
        return false;
 
961
        return OPJ_FALSE;
962
962
}
963
963