func (c *Motion) condenseBlocksAvg(frame *[]motionVector, buf *[]motionVector) {
	rowCount := c.Height / 16
	colCount := (c.Width + 16) / 16
	usableCols := colCount - 1

	mV := make([]mVhelper, usableCols/c.BlockWidth)
	i := 0
	compressedIndex := 0

	for x := 0; x < rowCount; x++ {
		blk := 1
		blkIndex := 0
		for y := 0; y < colCount; y++ {
			if y < usableCols {
				mV[blkIndex].add((*buf)[i])
			}
			if blk == c.BlockWidth {
				blk = 0
				blkIndex++
			}
			blk++
			i++
		}
		if x%c.BlockWidth == 0 {
			for idx, v := range mV {
				(*frame)[compressedIndex] = v.getAvg()
				mV[idx].reset()
				compressedIndex++
			}
		}
	}
}
// condenseBlocksAvg takes a blockWidth * blockWidth average of macroblocks from buf and stores the
// condensed result into frame
condenseBlocksAvg takes a blockWidth * blockWidth average of macroblocks from buf and stores the
condensed result into frame
// condenseBlocksAvg takes a blockWidth * blockWidth average of macroblocks from buf and stores the // condensed result into frame
func (c *Motion) condenseBlocksAvg(frame *[]motionVector, buf *[]motionVector) {
	rowCount := c.Height / 16
	colCount := (c.Width + 16) / 16
	usableCols := colCount - 1
	mV := make([]mVhelper, usableCols/c.BlockWidth)
	i := 0
	compressedIndex := 0
	for x := 0; x < rowCount; x++ {
		blk := 1
		blkIndex := 0
		for y := 0; y < colCount; y++ {
			if y < usableCols {
				mV[blkIndex].add((*buf)[i])
			}
			if blk == c.BlockWidth {
				blk = 0
				blkIndex++
			}
			blk++
			i++
		}
		if x%c.BlockWidth == 0 {
			for idx, v := range mV {
				(*frame)[compressedIndex] = v.getAvg()
				mV[idx].reset()
				compressedIndex++
			}
		}
	}
}
func ( c * Motion ) condenseBlocksAvg ( frame * [ ] motionVector , buf * [ ] motionVector ) { rowCount := c . Height / 16 colCount := ( c . Width + 16 ) / 16 usableCols := colCount - 1 mV := make ( [ ] mVhelper , usableCols / c . BlockWidth ) i := 0 compressedIndex := 0 for x := 0 ; x < rowCount ; x ++ { blk := 1 blkIndex := 0 for y := 0 ; y < colCount ; y ++ { if y < usableCols { mV [ blkIndex ] . add ( ( * buf ) [ i ] ) } if blk == c . BlockWidth { blk = 0 blkIndex ++ } blk ++ i ++ } if x % c . BlockWidth == 0 { for idx , v := range mV { ( * frame ) [ compressedIndex ] = v . getAvg ( ) mV [ idx ] . reset ( ) compressedIndex ++ } } } }
condenseBlocksAvg takes a blockWidth * blockWidth average of macroblocks from buf and stores the
condensed result into frame
condenseBlocksAvg takes a blockWidth * blockWidth average of macroblocks from buf and stores the condensed result into frame