[Sumover-dev] [Media Tools] #67: Consolidate thumbnails when adjacent rows are partially filled

Media Tools SUMOVER-dev at cs.ucl.ac.uk
Mon Apr 23 18:23:12 BST 2007


#67: Consolidate thumbnails when adjacent rows are partially filled
---------------------------------+------------------------------------------
 Reporter:  edbrannin at gmail.com  |       Owner:  socrates
     Type:  enhancement          |      Status:  new     
 Priority:  minor                |   Milestone:          
Component:  vic                  |     Version:  4.2.27  
 Keywords:                       |  
---------------------------------+------------------------------------------
 VIC Currently removes empty rows (what I call "the Tetris thing") to
 consolidate thumbnails, but fragmentation is still an issue in venues with
 high turnover.

 The other day, I was thinking about this and scribbled an algorithm that
 should consolidate rows much more effectively, without affecting the order
 of thumbnails:

 {{{
 # psudo-python
 def VideoRange(row):
   start = stop = -1
   for col in rows[row]:
     if rows[row][col] is not empty:
       start = col if start == -1
       stop = col
   return [start, stop]

 # on_video_stop:
 For r in rows.size - 1:
   current_start, current_stop = VideoRange(r)
   next_start, next_stop = VideoRange(r+1)
     consolidate(r,r+1) if current_start > next_stop
 }}}

 In short, that should consolidate thumbnails with arrangements like this
 (if someone with 4 videos disconnects:

 {{{
 X X X      X X X
 X _ _  ==> X _ X
 _ _ X  ==> X X X
 X X X
 }}}

 Since this seems like it might be a good introduction to the codebase,
 we'd like to give it a shot -- I'm reporting it here for comments and
 truck-factor before we actually make a patch.

-- 
Ticket URL: <https://mediatools.cs.ucl.ac.uk/nets/mmedia/ticket/67>
Media Tools <http://www-mice.cs.ucl.ac.uk/multimedia/software>
Media Tools


More information about the Sumover-dev mailing list