comparison vp3.c @ 11637:f7281af560fe libavcodec

vp3: DC-only IDCT 2-4% faster overall decode
author conrad
date Sat, 17 Apr 2010 02:04:30 +0000
parents a9e758788a12
children fb475c791336
comparison
equal deleted inserted replaced
11636:a9e758788a12 11637:f7281af560fe
1393 1393
1394 first_pixel = 8*y*stride + 8*x; 1394 first_pixel = 8*y*stride + 8*x;
1395 1395
1396 /* transform if this block was coded */ 1396 /* transform if this block was coded */
1397 if (s->all_fragments[i].coding_method != MODE_COPY) { 1397 if (s->all_fragments[i].coding_method != MODE_COPY) {
1398 int intra = s->all_fragments[i].coding_method == MODE_INTRA;
1399
1400 if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) || 1398 if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) ||
1401 (s->all_fragments[i].coding_method == MODE_GOLDEN_MV)) 1399 (s->all_fragments[i].coding_method == MODE_GOLDEN_MV))
1402 motion_source= golden_plane; 1400 motion_source= golden_plane;
1403 else 1401 else
1404 motion_source= last_plane; 1402 motion_source= last_plane;
1454 stride, 8); 1452 stride, 8);
1455 } 1453 }
1456 } 1454 }
1457 1455
1458 s->dsp.clear_block(block); 1456 s->dsp.clear_block(block);
1459 vp3_dequant(s, s->all_fragments + i, plane, !intra, block);
1460 1457
1461 /* invert DCT and place (or add) in final output */ 1458 /* invert DCT and place (or add) in final output */
1462 1459
1463 if (s->all_fragments[i].coding_method == MODE_INTRA) { 1460 if (s->all_fragments[i].coding_method == MODE_INTRA) {
1461 vp3_dequant(s, s->all_fragments + i, plane, 0, block);
1464 if(s->avctx->idct_algo!=FF_IDCT_VP3) 1462 if(s->avctx->idct_algo!=FF_IDCT_VP3)
1465 block[0] += 128<<3; 1463 block[0] += 128<<3;
1466 s->dsp.idct_put( 1464 s->dsp.idct_put(
1467 output_plane + first_pixel, 1465 output_plane + first_pixel,
1468 stride, 1466 stride,
1469 block); 1467 block);
1470 } else { 1468 } else {
1469 if (vp3_dequant(s, s->all_fragments + i, plane, 1, block)) {
1471 s->dsp.idct_add( 1470 s->dsp.idct_add(
1472 output_plane + first_pixel, 1471 output_plane + first_pixel,
1473 stride, 1472 stride,
1474 block); 1473 block);
1474 } else {
1475 s->dsp.vp3_idct_dc_add(output_plane + first_pixel, stride, block);
1476 }
1475 } 1477 }
1476 } else { 1478 } else {
1477 1479
1478 /* copy directly from the previous frame */ 1480 /* copy directly from the previous frame */
1479 s->dsp.put_pixels_tab[1][0]( 1481 s->dsp.put_pixels_tab[1][0](