View Issue Details

IDProjectCategoryView StatusLast Update
0000023JVT JM H.264/AVC reference softwaredecoderpublic2006-11-23 10:33
ReporterLoren Merritt Assigned ToAlexis Michael Tourapis  
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product VersionJM 11.0 
Summary0000023: decoder optimization
DescriptionThis patch makes ldecod about 25% faster on progressive streams.
Even after patching, getNonAffNeighbour still takes 8% of the total decode time, but further improvement (i.e. removing the remaining division) would require more invasive changes.
TagsNo tags attached.

Activities

2006-11-16 23:17

 

mb_access.diff (849 bytes)   
--- ldecod/src/mb_access.c	2004-10-29 23:51:00.000000000 -0600 (JM11.0)
+++ ldecod/src/mb_access.c	2006-08-19 23:14:47.000000000 -0600
@@ -185,19 +185,12 @@
 
   if (pix->available || img->DeblockCall)
   {
-    pix->x = (xN + maxW) % maxW;
-    pix->y = (yN + maxH) % maxH;
-    get_mb_pos(pix->mb_addr, &(pix->pos_x), &(pix->pos_y));
-    if (luma)
-    {
-      pix->pos_x += pix->x;
-      pix->pos_y += pix->y;
-    }
-    else
-    {
-      pix->pos_x = pix->pos_x/(16/img->mb_cr_size_x) + pix->x;
-      pix->pos_y = pix->pos_y/(16/img->mb_cr_size_y) + pix->y;
-    }
+    unsigned int mb_addr = pix->mb_addr;
+    unsigned int width = dec_picture->PicWidthInMbs;
+    pix->x = xN & (maxW - 1);
+    pix->y = yN & (maxH - 1);
+    pix->pos_x = (mb_addr % width) * maxW + pix->x;
+    pix->pos_y = (mb_addr / width) * maxH + pix->y;
   }
 }
 
mb_access.diff (849 bytes)   

Alexis Michael Tourapis

2006-11-21 09:50

developer   ~0000031

The encoder has already been changed to use memory lookup to avoid divides for these operations. The same can also be done for the decoder. Furthermore, the conditionals for mbaff can be completely avoided using function pointers.

Alexis Michael Tourapis

2006-11-22 03:12

developer   ~0000032

Dear Loren,

For your interest, I have considerably rehashed the decoder and will try to improve it even further. Speed has been considerably improved in my version (not yet in CVS) with a variety of enhancements and simple code restructuring.

Alexis

Alexis Michael Tourapis

2006-11-23 10:33

developer   ~0000033

A revision of suggested update and several other optimizations were introduced in the JM decoder, vastly improving decoding speed.

Issue History

Date Modified Username Field Change
2006-11-16 23:17 Loren Merritt New Issue
2006-11-16 23:17 Loren Merritt File Added: mb_access.diff
2006-11-21 09:50 Alexis Michael Tourapis Note Added: 0000031
2006-11-22 03:12 Alexis Michael Tourapis Note Added: 0000032
2006-11-23 10:31 Alexis Michael Tourapis Status new => assigned
2006-11-23 10:31 Alexis Michael Tourapis Assigned To => Alexis Michael Tourapis
2006-11-23 10:33 Alexis Michael Tourapis Status assigned => resolved
2006-11-23 10:33 Alexis Michael Tourapis Resolution open => fixed
2006-11-23 10:33 Alexis Michael Tourapis Note Added: 0000033