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

Side by Side Diff: src/liblzma/lzma/lzma_encoder.c

Issue 7109015: Update XZ Utils to 5.0.3 (in deps) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/xz/
Patch Set: Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/liblzma/lzma/lzma_decoder.c ('k') | src/liblzma/lzma/lzma_encoder_presets.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /////////////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////////
2 // 2 //
3 /// \file lzma_encoder.c 3 /// \file lzma_encoder.c
4 /// \brief LZMA encoder 4 /// \brief LZMA encoder
5 /// 5 ///
6 // Authors: Igor Pavlov 6 // Authors: Igor Pavlov
7 // Lasse Collin 7 // Lasse Collin
8 // 8 //
9 // This file has been put into the public domain. 9 // This file has been put into the public domain.
10 // You can do whatever you want with this file. 10 // You can do whatever you want with this file.
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 // everything out from the range encoder. For the same reason, 327 // everything out from the range encoder. For the same reason,
328 // rc_encode() never returns true when this function is used 328 // rc_encode() never returns true when this function is used
329 // as part of LZMA2 encoder. 329 // as part of LZMA2 encoder.
330 if (rc_encode(&coder->rc, out, out_pos, out_size)) { 330 if (rc_encode(&coder->rc, out, out_pos, out_size)) {
331 assert(limit == UINT32_MAX); 331 assert(limit == UINT32_MAX);
332 return LZMA_OK; 332 return LZMA_OK;
333 } 333 }
334 334
335 // With LZMA2 we need to take care that compressed size of 335 // With LZMA2 we need to take care that compressed size of
336 // a chunk doesn't get too big. 336 // a chunk doesn't get too big.
337 » » // TODO 337 » » // FIXME? Check if this could be improved.
338 if (limit != UINT32_MAX 338 if (limit != UINT32_MAX
339 && (mf->read_pos - mf->read_ahead >= limit 339 && (mf->read_pos - mf->read_ahead >= limit
340 || *out_pos + rc_pending(&coder->rc) 340 || *out_pos + rc_pending(&coder->rc)
341 >= LZMA2_CHUNK_MAX 341 >= LZMA2_CHUNK_MAX
342 - LOOP_INPUT_MAX)) 342 - LOOP_INPUT_MAX))
343 break; 343 break;
344 344
345 // Check that there is some input to process. 345 // Check that there is some input to process.
346 if (mf->read_pos >= mf->read_limit) { 346 if (mf->read_pos >= mf->read_limit) {
347 if (mf->action == LZMA_RUN) 347 if (mf->action == LZMA_RUN)
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 return LZMA_OK; 666 return LZMA_OK;
667 } 667 }
668 #endif 668 #endif
669 669
670 670
671 extern LZMA_API(lzma_bool) 671 extern LZMA_API(lzma_bool)
672 lzma_mode_is_supported(lzma_mode mode) 672 lzma_mode_is_supported(lzma_mode mode)
673 { 673 {
674 return mode == LZMA_MODE_FAST || mode == LZMA_MODE_NORMAL; 674 return mode == LZMA_MODE_FAST || mode == LZMA_MODE_NORMAL;
675 } 675 }
OLDNEW
« no previous file with comments | « src/liblzma/lzma/lzma_decoder.c ('k') | src/liblzma/lzma/lzma_encoder_presets.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698