Unified · Split
| @@ -74,7 +74,6 @@ static int setup_texture(AVCodecContext *avctx, size_t length) · 73 unmodified lines | ||
| 74 | 74 | HapContext *ctx = avctx->priv_data; |
| 75 | 75 | GetByteContext *gbc = &ctx->gbc; |
| 76 | 76 | int64_t snappy_size; |
| 77 | − const char *texture_name; | |
| 78 | 77 | const char *compressorstr; |
| 79 | 78 | int ret; |
| 80 | 79 | |
| @@ -83,22 +82,6 @@ static int setup_texture(AVCodecContext *avctx, size_t length) · 2 unmodified lines | ||
| 83 | 82 | || (avctx->codec_tag == MKTAG('H','a','p','Y') && (ctx->section_type & 0x0F) != HAP_FMT_YCOCGDXT5)) |
| 84 | 83 | return AVERROR_INVALIDDATA; |
| 85 | 84 | |
| 86 | − switch (ctx->section_type & 0x0F) { | |
| 87 | − case HAP_FMT_RGBDXT1: | |
| 88 | − texture_name = "DXT1"; | |
| 89 | − break; | |
| 90 | − case HAP_FMT_RGBADXT5: | |
| 91 | − texture_name = "DXT5"; | |
| 92 | − break; | |
| 93 | − case HAP_FMT_YCOCGDXT5: | |
| 94 | − texture_name = "DXT5-YCoCg-scaled"; | |
| 95 | − break; | |
| 96 | − default: | |
| 97 | − av_log(avctx, AV_LOG_ERROR, | |
| 98 | − "Invalid format mode %02X.\n", ctx->section_type); | |
| 99 | − return AVERROR_INVALIDDATA; | |
| 100 | − } | |
| 101 | − | |
| 102 | 85 | switch (ctx->section_type & 0xF0) { |
| 103 | 86 | case HAP_COMP_NONE: |
| 104 | 87 | /* Only DXTC texture compression */ |
| @@ -134,8 +117,7 @@ static int setup_texture(AVCodecContext *avctx, size_t length) · 29 unmodified lines | ||
| 134 | 117 | return AVERROR_INVALIDDATA; |
| 135 | 118 | } |
| 136 | 119 | |
| 137 | − av_log(avctx, AV_LOG_DEBUG, "%s texture with %s compressor\n", | |
| 138 | − texture_name, compressorstr); | |
| 120 | + av_log(avctx, AV_LOG_DEBUG, "%s compressor\n", compressorstr); | |
| 139 | 121 | |
| 140 | 122 | return 0; |
| 141 | 123 | } |
| @@ -198,6 +180,7 @@ static int hap_decode(AVCodecContext *avctx, void *data, · 56 unmodified lines | ||
| 198 | 180 | static av_cold int hap_init(AVCodecContext *avctx) |
| 199 | 181 | { |
| 200 | 182 | HapContext *ctx = avctx->priv_data; |
| 183 | + const char *texture_name; | |
| 201 | 184 | int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); |
| 202 | 185 | |
| 203 | 186 | if (ret < 0) { |
| @@ -217,20 +200,26 @@ static av_cold int hap_init(AVCodecContext *avctx) · 13 unmodified lines | ||
| 217 | 200 | |
| 218 | 201 | switch (avctx->codec_tag) { |
| 219 | 202 | case MKTAG('H','a','p','1'): |
| 203 | + texture_name = "DXT1"; | |
| 220 | 204 | ctx->tex_rat = 8; |
| 221 | 205 | ctx->tex_fun = ctx->dxtc.dxt1_block; |
| 222 | 206 | break; |
| 223 | 207 | case MKTAG('H','a','p','5'): |
| 208 | + texture_name = "DXT5"; | |
| 224 | 209 | ctx->tex_rat = 16; |
| 225 | 210 | ctx->tex_fun = ctx->dxtc.dxt5_block; |
| 226 | 211 | break; |
| 227 | 212 | case MKTAG('H','a','p','Y'): |
| 213 | + texture_name = "DXT5-YCoCg-scaled"; | |
| 228 | 214 | ctx->tex_rat = 16; |
| 229 | 215 | ctx->tex_fun = ctx->dxtc.dxt5ys_block; |
| 230 | 216 | break; |
| 231 | 217 | default: |
| 232 | 218 | return AVERROR_DECODER_NOT_FOUND; |
| 233 | 219 | } |
| 220 | + | |
| 221 | + av_log(avctx, AV_LOG_DEBUG, "%s texture\n", texture_name); | |
| 222 | + | |
| 234 | 223 | return 0; |
| 235 | 224 | } |
| 236 | 225 | |