Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/pi.c

Issue 960183004: Upgrade openjpeg to revision 2997. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * The copyright in this software is being made available under the 2-clauses 2 * The copyright in this software is being made available under the 2-clauses
3 * BSD License, included below. This software may be subject to other third 3 * BSD License, included below. This software may be subject to other third
4 * party and contributor rights, including patent rights, and no such rights 4 * party and contributor rights, including patent rights, and no such rights
5 * are granted under this license. 5 * are granted under this license.
6 * 6 *
7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium 7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
8 * Copyright (c) 2002-2014, Professor Benoit Macq 8 * Copyright (c) 2002-2014, Professor Benoit Macq
9 * Copyright (c) 2001-2003, David Janssens 9 * Copyright (c) 2001-2003, David Janssens
10 * Copyright (c) 2002-2003, Yannick Verschueren 10 * Copyright (c) 2002-2003, Yannick Verschueren
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 const opj_tcp_t *tcp = 00; 686 const opj_tcp_t *tcp = 00;
687 const opj_tccp_t * l_tccp = 00; 687 const opj_tccp_t * l_tccp = 00;
688 const opj_image_comp_t * l_img_comp = 00; 688 const opj_image_comp_t * l_img_comp = 00;
689 689
690 /* to store l_dx, l_dy, w and h for each resolution and component.*/ 690 /* to store l_dx, l_dy, w and h for each resolution and component.*/
691 OPJ_UINT32 * lResolutionPtr; 691 OPJ_UINT32 * lResolutionPtr;
692 692
693 /* position in x and y of tile*/ 693 /* position in x and y of tile*/
694 OPJ_UINT32 p, q; 694 OPJ_UINT32 p, q;
695 695
696 /* non-corrected (in regard to image offset) tile offset */
697 OPJ_UINT32 l_tx0, l_ty0;
698
696 /* preconditions in debug*/ 699 /* preconditions in debug*/
697 assert(p_cp != 00); 700 assert(p_cp != 00);
698 assert(p_image != 00); 701 assert(p_image != 00);
699 assert(tileno < p_cp->tw * p_cp->th); 702 assert(tileno < p_cp->tw * p_cp->th);
700 703
701 /* initializations*/ 704 /* initializations*/
702 tcp = &p_cp->tcps [tileno]; 705 tcp = &p_cp->tcps [tileno];
703 l_tccp = tcp->tccps; 706 l_tccp = tcp->tccps;
704 l_img_comp = p_image->comps; 707 l_img_comp = p_image->comps;
705 708
706 /* position in x and y of tile*/ 709 /* position in x and y of tile*/
707 p = tileno % p_cp->tw; 710 p = tileno % p_cp->tw;
708 q = tileno / p_cp->tw; 711 q = tileno / p_cp->tw;
709 712
710 /* here calculation of tx0, tx1, ty0, ty1, maxprec, l_dx and l_dy */ 713 /* here calculation of tx0, tx1, ty0, ty1, maxprec, l_dx and l_dy */
711 » *p_tx0 = opj_int_max((OPJ_INT32)(p_cp->tx0 + p * p_cp->tdx), (OPJ_INT32) p_image->x0); 714 » l_tx0 = p_cp->tx0 + p * p_cp->tdx; /* can't be greater than p_image->x1 so won't overflow */
712 » *p_tx1 = opj_int_min((OPJ_INT32)(p_cp->tx0 + (p + 1) * p_cp->tdx), (OPJ_ INT32)p_image->x1); 715 » *p_tx0 = (OPJ_INT32)opj_uint_max(l_tx0, p_image->x0);
713 » *p_ty0 = opj_int_max((OPJ_INT32)(p_cp->ty0 + q * p_cp->tdy), (OPJ_INT32) p_image->y0); 716 » *p_tx1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_tx0, p_cp->tdx), p_imag e->x1);
714 » *p_ty1 = opj_int_min((OPJ_INT32)(p_cp->ty0 + (q + 1) * p_cp->tdy), (OPJ_ INT32)p_image->y1); 717 » l_ty0 = p_cp->ty0 + q * p_cp->tdy; /* can't be greater than p_image->y1 so won't overflow */
718 » *p_ty0 = (OPJ_INT32)opj_uint_max(l_ty0, p_image->y0);
719 » *p_ty1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_ty0, p_cp->tdy), p_imag e->y1);
715 720
716 /* max precision and resolution is 0 (can only grow)*/ 721 /* max precision and resolution is 0 (can only grow)*/
717 *p_max_prec = 0; 722 *p_max_prec = 0;
718 *p_max_res = 0; 723 *p_max_res = 0;
719 724
720 /* take the largest value for dx_min and dy_min*/ 725 /* take the largest value for dx_min and dy_min*/
721 *p_dx_min = 0x7fffffff; 726 *p_dx_min = 0x7fffffff;
722 *p_dy_min = 0x7fffffff; 727 *p_dy_min = 0x7fffffff;
723 728
724 for (compno = 0; compno < p_image->numcomps; ++compno) { 729 for (compno = 0; compno < p_image->numcomps; ++compno) {
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 case OPJ_PCRL: 1868 case OPJ_PCRL:
1864 return opj_pi_next_pcrl(pi); 1869 return opj_pi_next_pcrl(pi);
1865 case OPJ_CPRL: 1870 case OPJ_CPRL:
1866 return opj_pi_next_cprl(pi); 1871 return opj_pi_next_cprl(pi);
1867 case OPJ_PROG_UNKNOWN: 1872 case OPJ_PROG_UNKNOWN:
1868 return OPJ_FALSE; 1873 return OPJ_FALSE;
1869 } 1874 }
1870 1875
1871 return OPJ_FALSE; 1876 return OPJ_FALSE;
1872 } 1877 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698