org.jcodec.codecs.h264.decode.aso
Class SliceGroupMapBuilder

java.lang.Object
  extended by org.jcodec.codecs.h264.decode.aso.SliceGroupMapBuilder

public class SliceGroupMapBuilder
extends Object

This class is part of JCodec ( www.jcodec.org ) This software is distributed under FreeBSD License A helper class that builds macroblock to slice group maps needed by ASO (Arbitrary Slice Order)

Author:
Jay Codec

Constructor Summary
SliceGroupMapBuilder()
           
 
Method Summary
static int[] buildBoxOutMap(int picWidthInMbs, int picHeightInMbs, boolean changeDirection, int numberOfMbsInBox)
          A boxout macroblock to slice group mapping.
static int[] buildDispersedMap(int picWidthInMbs, int picHeightInMbs, int numSliceGroups)
          A dispersed map.
static int[] buildForegroundMap(int picWidthInMbs, int picHeightInMbs, int numSliceGroups, int[] topLeftAddr, int[] bottomRightAddr)
          A foreground macroblock to slice group map.
static int[] buildInterleavedMap(int picWidthInMbs, int picHeightInMbs, int[] runLength)
          Interleaved slice group map.
static int[] buildRasterScanMap(int picWidthInMbs, int picHeightInMbs, int sizeOfUpperLeftGroup, boolean changeDirection)
          A macroblock to slice group map that fills frame in raster scan.
static int[] buildWipeMap(int picWidthInMbs, int picHeightInMbs, int sizeOfUpperLeftGroup, boolean changeDirection)
          A macroblock to slice group map that fills frame column by column
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SliceGroupMapBuilder

public SliceGroupMapBuilder()
Method Detail

buildInterleavedMap

public static int[] buildInterleavedMap(int picWidthInMbs,
                                        int picHeightInMbs,
                                        int[] runLength)
Interleaved slice group map. Each slice group fills a number of cells equal to the appropriate run length, then followed by the next slice group. Example: 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1,


buildDispersedMap

public static int[] buildDispersedMap(int picWidthInMbs,
                                      int picHeightInMbs,
                                      int numSliceGroups)
A dispersed map. Every odd line starts from the (N / 2)th group Example: 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1


buildForegroundMap

public static int[] buildForegroundMap(int picWidthInMbs,
                                       int picHeightInMbs,
                                       int numSliceGroups,
                                       int[] topLeftAddr,
                                       int[] bottomRightAddr)
A foreground macroblock to slice group map. Macroblocks of the last slice group are the background, all the others represent rectangles covering areas with top-left corner specified by topLeftAddr[group] and bottom right corner specified by bottomRightAddr[group].

Parameters:
picWidthInMbs -
picHeightInMbs -
numSliceGroups - Total number of slice groups
topLeftAddr - Addresses of macroblocks that are top-left corners of respective slice groups
bottomRightAddr - Addresses macroblocks that are bottom-right corners of respective slice groups
Returns:

buildBoxOutMap

public static int[] buildBoxOutMap(int picWidthInMbs,
                                   int picHeightInMbs,
                                   boolean changeDirection,
                                   int numberOfMbsInBox)
A boxout macroblock to slice group mapping. Only applicable when there's exactly 2 slice groups. Slice group 1 is a background, while slice group 0 is a box in the middle of the frame.

Parameters:
picWidthInMbs -
picHeightInMbs -
changeDirection -
numberOfMbsInBox - number of macroblocks in slice group 0
Returns:

buildRasterScanMap

public static int[] buildRasterScanMap(int picWidthInMbs,
                                       int picHeightInMbs,
                                       int sizeOfUpperLeftGroup,
                                       boolean changeDirection)
A macroblock to slice group map that fills frame in raster scan.

Parameters:
picWidthInMbs -
picHeightInMbs -
sizeOfUpperLeftGroup -
changeDirection -
Returns:

buildWipeMap

public static int[] buildWipeMap(int picWidthInMbs,
                                 int picHeightInMbs,
                                 int sizeOfUpperLeftGroup,
                                 boolean changeDirection)
A macroblock to slice group map that fills frame column by column

Parameters:
picWidthInMbs -
picHeightInMbs -
sizeOfUpperLeftGroup -
changeDirection -
Returns:


Copyright © 2013. All Rights Reserved.