Ticket #4876: 0001-Use-correct-zigzag-for-weight-tables-for-new-CIDs-12.patch
| File 0001-Use-correct-zigzag-for-weight-tables-for-new-CIDs-12.patch, 6.2 KB (added by , 11 years ago) |
|---|
-
libavcodec/dnxhddata.c
From a2a9840cec1402c6c6859d49cfba7270b25558dc Mon Sep 17 00:00:00 2001 From: Jeremy James <jeremy.james@gmail.com> Date: Fri, 25 Sep 2015 11:55:49 +0100 Subject: [PATCH] Use correct DNxHD zigzags Use correct DNxHD zigzag for weight tables for new CIDs 1258, 1259, and 1260, as well as fixing an incorrect chroma table for CID 1256. --- libavcodec/dnxhddata.c | 103 +++++++++++++++--------------------------------- 1 file changed, 31 insertions(+), 72 deletions(-) diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c index 9d2e4e8..cc304e4 100644
a b static const uint8_t dnxhd_1235_chroma_weight[] = { 48 48 90, 90, 85, 79, 73, 73, 73, 73, 49 49 }; 50 50 51 /* Used in CID 1237, 1253 */51 /* Used in CID 1237, 1253, 1259 */ 52 52 static const uint8_t dnxhd_1237_luma_weight[] = { 53 53 0, 32, 33, 34, 34, 36, 37, 36, 54 54 36, 37, 38, 38, 38, 39, 41, 44, … … static const uint8_t dnxhd_1237_luma_weight[] = { 60 60 97, 100, 104, 102, 98, 98, 99, 99, 61 61 }; 62 62 63 /* Used in CID 1237, 1253 */63 /* Used in CID 1237, 1253, 1259 */ 64 64 static const uint8_t dnxhd_1237_chroma_weight[] = { 65 65 0, 32, 36, 39, 39, 38, 39, 41, 66 66 45, 51, 57, 58, 53, 48, 47, 51, … … static const uint8_t dnxhd_1251_chroma_weight[] = { 204 204 61, 59, 59, 59, 61, 62, 62, 62, 205 205 }; 206 206 207 /* Used in CID 1252, 1258 */ 207 208 static const uint8_t dnxhd_1252_luma_weight[] = { 208 209 0, 32, 34, 35, 36, 36, 36, 37, 209 210 36, 37, 39, 40, 41, 40, 40, 40, … … static const uint8_t dnxhd_1252_luma_weight[] = { 214 215 71, 82, 90, 90, 88, 87, 90, 95, 215 216 100, 107, 103, 97, 95, 93, 99, 99, 216 217 }; 218 219 /* Used in CID 1252, 1258 */ 217 220 static const uint8_t dnxhd_1252_chroma_weight[] = { 218 221 0, 32, 35, 36, 37, 37, 38, 40, 219 222 42, 46, 49, 50, 50, 49, 49, 53, … … static const uint8_t dnxhd_1252_chroma_weight[] = { 226 229 }; 227 230 228 231 static const uint8_t dnxhd_1256_chroma_weight[] = { 229 0, 32, 32, 32, 32, 32, 32, 33, 230 32, 32, 32, 32, 32, 32, 32, 34, 231 32, 32, 32, 32, 32, 32, 33, 37, 232 32, 32, 32, 32, 32, 32, 36, 39, 233 32, 32, 32, 32, 32, 34, 39, 44, 234 32, 37, 32, 32, 35, 40, 43, 49, 235 32, 33, 36, 36, 40, 43, 50, 60, 236 34, 37, 39, 44, 51, 56, 61, 70, 237 }; 238 239 static const uint8_t dnxhd_1258_luma_weight[] = { 240 0, 32, 36, 36, 40, 40, 55, 60, 241 34, 36, 37, 40, 41, 48, 57, 82, 242 35, 36, 41, 41, 46, 52, 73, 82, 243 37, 40, 42, 45, 50, 65, 80, 87, 244 39, 41, 44, 49, 62, 78, 88, 90, 245 41, 44, 49, 58, 73, 90, 95, 95, 246 43, 52, 55, 68, 90, 100, 97, 93, 247 52, 53, 71, 82, 107, 103, 99, 99, 248 }; 249 250 static const uint8_t dnxhd_1258_chroma_weight[] = { 251 0, 32, 37, 38, 49, 53, 65, 66, 252 35, 37, 40, 49, 56, 64, 65, 82, 253 36, 42, 50, 56, 64, 67, 73, 85, 254 46, 50, 57, 63, 71, 72, 89, 87, 255 49, 58, 65, 72, 78, 88, 88, 90, 256 60, 64, 74, 81, 84, 90, 95, 134, 257 62, 74, 77, 80, 90, 114, 129, 125, 258 74, 74, 90, 100, 128, 125, 116, 116, 259 }; 260 261 static const uint8_t dnxhd_1259_luma_weight[] = { 262 0, 32, 36, 37, 41, 44, 54, 60, 263 33, 34, 36, 39, 43, 51, 62, 78, 264 34, 36, 38, 41, 49, 59, 73, 79, 265 37, 38, 40, 47, 55, 66, 80, 95, 266 38, 41, 46, 54, 63, 79, 93, 96, 267 46, 47, 56, 64, 78, 90, 97, 98, 268 49, 58, 66, 78, 89, 97, 102, 98, 269 61, 65, 82, 87, 100, 104, 99, 99, 270 }; 271 272 static const uint8_t dnxhd_1259_chroma_weight[] = { 273 0, 32, 38, 39, 47, 51, 77, 83, 274 36, 39, 41, 48, 55, 74, 85, 95, 275 39, 45, 53, 58, 72, 83, 105, 89, 276 51, 58, 66, 73, 82, 109, 92, 95, 277 57, 75, 78, 89, 105, 95, 93, 96, 278 81, 82, 99, 99, 94, 90, 97, 98, 279 83, 96, 97, 93, 89, 97, 102, 98, 280 90, 94, 92, 88, 100, 104, 99, 99, 232 0, 32, 32, 32, 32, 32, 32, 32, 233 32, 32, 32, 32, 32, 32, 32, 32, 234 32, 32, 32, 32, 32, 32, 37, 32, 235 32, 32, 32, 32, 33, 32, 32, 32, 236 32, 32, 33, 34, 37, 36, 32, 32, 237 32, 33, 34, 37, 36, 34, 35, 36, 238 39, 44, 40, 40, 39, 39, 44, 43, 239 43, 51, 56, 50, 49, 60, 61, 70, 281 240 }; 282 241 283 242 static const uint8_t dnxhd_1260_luma_weight[] = { 284 0, 32, 3 7, 37, 40, 41, 52, 53,285 3 3, 36, 36, 38, 40, 48, 49, 52,286 34, 34, 37, 39, 44, 47, 49, 54,287 33, 35, 38, 40, 45, 46, 54, 51,288 34, 37, 37, 42, 44, 49, 52, 48,289 34, 34, 38, 43, 44, 51, 50, 50,290 33, 36, 41, 44, 51, 52, 50, 54,291 36, 38, 44, 47, 53, 53, 54, 54,243 0, 32, 33, 34, 36, 37, 37, 36, 244 34, 33, 34, 35, 37, 38, 40, 41, 245 40, 39, 38, 37, 34, 33, 34, 37, 246 40, 44, 48, 52, 53, 49, 47, 45, 247 42, 38, 36, 36, 38, 41, 43, 44, 248 46, 49, 52, 54, 54, 49, 44, 44, 249 44, 47, 51, 51, 52, 51, 48, 50, 250 52, 53, 53, 50, 50, 54, 54, 54, 292 251 }; 293 252 294 253 static const uint8_t dnxhd_1260_chroma_weight[] = { 295 0, 32, 40, 38, 42, 40, 45, 45,296 3 4, 42, 36, 43, 38, 46, 46, 49,297 38, 3 5, 43, 39, 44, 47, 47, 49,298 35, 42, 43, 42, 46, 47, 49, 52,299 38, 43, 43, 44, 50, 49, 56, 50,300 4 2, 43, 44, 50, 51, 57, 52, 53,301 41, 45, 46, 53, 53, 56, 53, 54,302 46, 46, 51, 49, 56, 53, 58, 58,254 0, 32, 34, 38, 42, 40, 38, 36, 255 35, 35, 38, 42, 43, 43, 42, 40, 256 38, 39, 43, 43, 42, 41, 43, 43, 257 42, 44, 46, 45, 45, 46, 47, 46, 258 44, 44, 45, 46, 46, 46, 50, 50, 259 47, 47, 49, 49, 49, 49, 51, 53, 260 51, 49, 53, 57, 56, 52, 50, 52, 261 56, 56, 53, 53, 53, 54, 58, 58, 303 262 }; 304 263 305 264 /* Used in CID 1235, 1241, 1250, 1256 */ … … const CIDEntry ff_dnxhd_cid_table[] = { 1090 1049 { 350, 390, 440, 730, 880 }, 1091 1050 { { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } }, 1092 1051 { 1258, 960, 720, 0, 212992, 212992, 4, 8, 5, 1093 dnxhd_125 8_luma_weight, dnxhd_1258_chroma_weight,1052 dnxhd_1252_luma_weight, dnxhd_1252_chroma_weight, 1094 1053 dnxhd_1237_dc_codes, dnxhd_1237_dc_bits, 1095 1054 dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level, 1096 1055 dnxhd_1252_ac_flags, 1097 1056 dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run, 1098 1057 { 42, 60, 75, 115 } }, 1099 1058 { 1259, 1440, 1080, 0, 417792, 417792, 4, 8, 3, 1100 dnxhd_12 59_luma_weight, dnxhd_1259_chroma_weight,1059 dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight, 1101 1060 dnxhd_1237_dc_codes, dnxhd_1237_dc_bits, 1102 1061 dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level, 1103 1062 dnxhd_1237_ac_flags,
