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

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

Issue 589243004: Update openjpeg (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Update to openjpeg r2891 Created 6 years, 2 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 /* 356 /*
357 ========================================================== 357 ==========================================================
358 MQ-Coder interface 358 MQ-Coder interface
359 ========================================================== 359 ==========================================================
360 */ 360 */
361 361
362 opj_mqc_t* opj_mqc_create(void) { 362 opj_mqc_t* opj_mqc_create(void) {
363 opj_mqc_t *mqc = (opj_mqc_t*)opj_malloc(sizeof(opj_mqc_t)); 363 opj_mqc_t *mqc = (opj_mqc_t*)opj_malloc(sizeof(opj_mqc_t));
364 #ifdef MQC_PERF_OPT 364 #ifdef MQC_PERF_OPT
365 » mqc->buffer = NULL; 365 » if (mqc) {
366 » » mqc->buffer = NULL;
367 » }
366 #endif 368 #endif
367 return mqc; 369 return mqc;
368 } 370 }
369 371
370 void opj_mqc_destroy(opj_mqc_t *mqc) { 372 void opj_mqc_destroy(opj_mqc_t *mqc) {
371 if(mqc) { 373 if(mqc) {
372 #ifdef MQC_PERF_OPT 374 #ifdef MQC_PERF_OPT
373 » » opj_free(mqc->buffer); 375 » » if (mqc->buffer) {
376 » » » opj_free(mqc->buffer);
377 » » }
374 #endif 378 #endif
375 opj_free(mqc); 379 opj_free(mqc);
376 } 380 }
377 } 381 }
378 382
379 OPJ_UINT32 opj_mqc_numbytes(opj_mqc_t *mqc) { 383 OPJ_UINT32 opj_mqc_numbytes(opj_mqc_t *mqc) {
380 const ptrdiff_t diff = mqc->bp - mqc->start; 384 const ptrdiff_t diff = mqc->bp - mqc->start;
381 #if 0 385 #if 0
382 assert( diff <= 0xffffffff && diff >= 0 ); /* UINT32_MAX */ 386 assert( diff <= 0xffffffff && diff >= 0 ); /* UINT32_MAX */
383 #endif 387 #endif
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 for (i = 0; i < MQC_NUMCTXS; i++) { 605 for (i = 0; i < MQC_NUMCTXS; i++) {
602 mqc->ctxs[i] = mqc_states; 606 mqc->ctxs[i] = mqc_states;
603 } 607 }
604 } 608 }
605 609
606 void opj_mqc_setstate(opj_mqc_t *mqc, OPJ_UINT32 ctxno, OPJ_UINT32 msb, OPJ_INT3 2 prob) { 610 void opj_mqc_setstate(opj_mqc_t *mqc, OPJ_UINT32 ctxno, OPJ_UINT32 msb, OPJ_INT3 2 prob) {
607 mqc->ctxs[ctxno] = &mqc_states[msb + (OPJ_UINT32)(prob << 1)]; 611 mqc->ctxs[ctxno] = &mqc_states[msb + (OPJ_UINT32)(prob << 1)];
608 } 612 }
609 613
610 614
OLDNEW
« no previous file with comments | « core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/mct.c ('k') | core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/openjpeg.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698