| OLD | NEW |
| 1 /////////////////////////////////////////////////////////////////////////////// | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 // | 2 // |
| 3 /// \file filter_common.c | 3 /// \file filter_common.c |
| 4 /// \brief Filter-specific stuff common for both encoder and decoder | 4 /// \brief Filter-specific stuff common for both encoder and decoder |
| 5 // | 5 // |
| 6 // Author: Lasse Collin | 6 // Author: Lasse Collin |
| 7 // | 7 // |
| 8 // This file has been put into the public domain. | 8 // This file has been put into the public domain. |
| 9 // You can do whatever you want with this file. | 9 // You can do whatever you want with this file. |
| 10 // | 10 // |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } features[] = { | 36 } features[] = { |
| 37 #if defined (HAVE_ENCODER_LZMA1) || defined(HAVE_DECODER_LZMA1) | 37 #if defined (HAVE_ENCODER_LZMA1) || defined(HAVE_DECODER_LZMA1) |
| 38 { | 38 { |
| 39 .id = LZMA_FILTER_LZMA1, | 39 .id = LZMA_FILTER_LZMA1, |
| 40 .options_size = sizeof(lzma_options_lzma), | 40 .options_size = sizeof(lzma_options_lzma), |
| 41 .non_last_ok = false, | 41 .non_last_ok = false, |
| 42 .last_ok = true, | 42 .last_ok = true, |
| 43 .changes_size = true, | 43 .changes_size = true, |
| 44 }, | 44 }, |
| 45 #endif | 45 #endif |
| 46 #ifdef HAVE_DECODER_LZMA2 | 46 #if defined(HAVE_ENCODER_LZMA2) || defined(HAVE_DECODER_LZMA2) |
| 47 { | 47 { |
| 48 .id = LZMA_FILTER_LZMA2, | 48 .id = LZMA_FILTER_LZMA2, |
| 49 .options_size = sizeof(lzma_options_lzma), | 49 .options_size = sizeof(lzma_options_lzma), |
| 50 .non_last_ok = false, | 50 .non_last_ok = false, |
| 51 .last_ok = true, | 51 .last_ok = true, |
| 52 .changes_size = true, | 52 .changes_size = true, |
| 53 }, | 53 }, |
| 54 #endif | 54 #endif |
| 55 #ifdef HAVE_DECODER_X86 | 55 #if defined(HAVE_ENCODER_X86) || defined(HAVE_DECODER_X86) |
| 56 { | 56 { |
| 57 .id = LZMA_FILTER_X86, | 57 .id = LZMA_FILTER_X86, |
| 58 .options_size = sizeof(lzma_options_bcj), | 58 .options_size = sizeof(lzma_options_bcj), |
| 59 .non_last_ok = true, | 59 .non_last_ok = true, |
| 60 .last_ok = false, | 60 .last_ok = false, |
| 61 .changes_size = false, | 61 .changes_size = false, |
| 62 }, | 62 }, |
| 63 #endif | 63 #endif |
| 64 #if defined(HAVE_ENCODER_POWERPC) || defined(HAVE_DECODER_POWERPC) | 64 #if defined(HAVE_ENCODER_POWERPC) || defined(HAVE_DECODER_POWERPC) |
| 65 { | 65 { |
| 66 .id = LZMA_FILTER_POWERPC, | 66 .id = LZMA_FILTER_POWERPC, |
| 67 .options_size = sizeof(lzma_options_bcj), | 67 .options_size = sizeof(lzma_options_bcj), |
| 68 .non_last_ok = true, | 68 .non_last_ok = true, |
| 69 .last_ok = false, | 69 .last_ok = false, |
| 70 .changes_size = false, | 70 .changes_size = false, |
| 71 }, | 71 }, |
| 72 #endif | 72 #endif |
| 73 #ifdef HAVE_DECODER_IA64 | 73 #if defined(HAVE_ENCODER_IA64) || defined(HAVE_DECODER_IA64) |
| 74 { | 74 { |
| 75 .id = LZMA_FILTER_IA64, | 75 .id = LZMA_FILTER_IA64, |
| 76 .options_size = sizeof(lzma_options_bcj), | 76 .options_size = sizeof(lzma_options_bcj), |
| 77 .non_last_ok = true, | 77 .non_last_ok = true, |
| 78 .last_ok = false, | 78 .last_ok = false, |
| 79 .changes_size = false, | 79 .changes_size = false, |
| 80 }, | 80 }, |
| 81 #endif | 81 #endif |
| 82 #if defined(HAVE_ENCODER_ARM) || defined(HAVE_DECODER_ARM) | 82 #if defined(HAVE_ENCODER_ARM) || defined(HAVE_DECODER_ARM) |
| 83 { | 83 { |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 return UINT64_MAX; // Invalid options | 328 return UINT64_MAX; // Invalid options |
| 329 | 329 |
| 330 total += usage; | 330 total += usage; |
| 331 } | 331 } |
| 332 } while (filters[++i].id != LZMA_VLI_UNKNOWN); | 332 } while (filters[++i].id != LZMA_VLI_UNKNOWN); |
| 333 | 333 |
| 334 // Add some fixed amount of extra. It's to compensate memory usage | 334 // Add some fixed amount of extra. It's to compensate memory usage |
| 335 // of Stream, Block etc. coders, malloc() overhead, stack etc. | 335 // of Stream, Block etc. coders, malloc() overhead, stack etc. |
| 336 return total + LZMA_MEMUSAGE_BASE; | 336 return total + LZMA_MEMUSAGE_BASE; |
| 337 } | 337 } |
| OLD | NEW |