Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.ccdtovcd.mpeg
Class MPEGStillEncoder  view MPEGStillEncoder download MPEGStillEncoder.java

java.lang.Object
  extended byorg.ccdtovcd.mpeg.MPEGStillEncoder

public class MPEGStillEncoder
extends java.lang.Object


Nested Class Summary
private  class MPEGStillEncoder.Block
           
private  class MPEGStillEncoder.EncodingEnv
           
private  class MPEGStillEncoder.Macroblock
           
 
Field Summary
private static int[][] ac_codes_intra
           
private static int[] ac_codes_special
           
private static int[][] ac_length_intra
           
private static int[] ac_length_special
           
private static int B_TYPE
           
private static int BLOCK_EOB
           
private static int BLOCK_ESCAPE
           
private static int CHROMINANCE
           
private static int[] diff_dc_add_codes_neg
           
private static int[] diff_dc_add_codes_pos
           
private static int[] diff_dc_add_length
           
private static int[] diff_dc_size_codes_chrom
           
private static int[] diff_dc_size_codes_lum
           
private static int[] diff_dc_size_length_chrom
           
private static int[] diff_dc_size_length_lum
           
private static int EXT_START_CODE
           
private static double[] fcostable
           
private static int GOP_START_CODE
           
private static int I_TYPE
           
private static double[] intraquant
           
private static int ISO_11172_END_CODE
           
private static int LUMINANCE
           
private static int[] macroblock_address_increment_code
           
private static int[] macroblock_address_increment_length
           
private static int mpegVersion
           
private static int P_TYPE
           
private static int PACK_START_CODE
           
private static int[] PACKET_START_CODE_PREFIX
           
private static int PADDING_STREAM_ID
           
private static int PICTURE_START_CODE
           
private static int SEQ_END_CODE
           
private static int SEQ_START_CODE
           
private static int SLICE_MAX_START_CODE
           
private static int SLICE_MIN_START_CODE
           
private static int STILL_PICTURE_STREAM_ID
           
private static int SYSTEM_HEADER_START_CODE
           
private static int USER_START_CODE
           
private static int[] zigzag
           
 
Constructor Summary
MPEGStillEncoder()
           
 
Method Summary
private  double c(int i)
           
 void encode(java.awt.image.BufferedImage bImage, boolean isNtsc, java.io.OutputStream outputStream, int qscale, boolean multiplex, int std_buffer_size, int vbv_buffer_size)
           
private  void encodeAC(MPEGStillEncoder.EncodingEnv ee, int runlength, int level)
           
private  void encodeDC(MPEGStillEncoder.EncodingEnv ee, int dc_diff, int type)
           
private  double getChromU(java.awt.Color c)
           
private  double getChromV(java.awt.Color c)
           
private  double getLum(java.awt.Color c)
           
private  MPEGStillEncoder.Macroblock getMacroblock(java.awt.image.BufferedImage bImage, int i, int j)
           
static void main(java.lang.String[] argv)
           
private  double mpeg1DFDCT(double[] v, int i, int offset)
           
private  void produceVideoStream(MPEGStillEncoder.EncodingEnv ee)
           
private  MPEGStillEncoder.Macroblock quantizeMacroblock(MPEGStillEncoder.EncodingEnv ee, MPEGStillEncoder.Macroblock mb)
           
private  void writeMacroblock(MPEGStillEncoder.EncodingEnv ee, MPEGStillEncoder.Macroblock mb, int i, int j)
           
private  void writeMiddlePack(MPEGStillEncoder.EncodingEnv ee, int clock, int length)
           
private  void writePackHeader(MPEGStillEncoder.EncodingEnv ee, int clock)
           
private  void writePadding(MPEGStillEncoder.EncodingEnv ee, int paddingLength)
           
private  void writeSystemHeader(MPEGStillEncoder.EncodingEnv ee)
           
private  void writeVideoPacket(MPEGStillEncoder.EncodingEnv ee, int length, int pts, int dts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LUMINANCE

private static final int LUMINANCE
See Also:
Constant Field Values

CHROMINANCE

private static final int CHROMINANCE
See Also:
Constant Field Values

BLOCK_EOB

private static final int BLOCK_EOB
See Also:
Constant Field Values

BLOCK_ESCAPE

private static final int BLOCK_ESCAPE
See Also:
Constant Field Values

fcostable

private static double[] fcostable

macroblock_address_increment_code

private static final int[] macroblock_address_increment_code

macroblock_address_increment_length

private static final int[] macroblock_address_increment_length

zigzag

private static final int[] zigzag

diff_dc_size_codes_lum

private static final int[] diff_dc_size_codes_lum

diff_dc_size_length_lum

private static final int[] diff_dc_size_length_lum

diff_dc_size_codes_chrom

private static final int[] diff_dc_size_codes_chrom

diff_dc_size_length_chrom

private static final int[] diff_dc_size_length_chrom

diff_dc_add_codes_pos

private static final int[] diff_dc_add_codes_pos

diff_dc_add_codes_neg

private static final int[] diff_dc_add_codes_neg

diff_dc_add_length

private static final int[] diff_dc_add_length

ac_codes_special

private static final int[] ac_codes_special

ac_length_special

private static final int[] ac_length_special

intraquant

private static final double[] intraquant

mpegVersion

private static final int mpegVersion
See Also:
Constant Field Values

ac_codes_intra

private static final int[][] ac_codes_intra

ac_length_intra

private static final int[][] ac_length_intra

PACK_START_CODE

private static final int PACK_START_CODE
See Also:
Constant Field Values

SYSTEM_HEADER_START_CODE

private static final int SYSTEM_HEADER_START_CODE
See Also:
Constant Field Values

ISO_11172_END_CODE

private static final int ISO_11172_END_CODE
See Also:
Constant Field Values

PACKET_START_CODE_PREFIX

private static final int[] PACKET_START_CODE_PREFIX

STILL_PICTURE_STREAM_ID

private static final int STILL_PICTURE_STREAM_ID
See Also:
Constant Field Values

PADDING_STREAM_ID

private static final int PADDING_STREAM_ID
See Also:
Constant Field Values

SEQ_END_CODE

private static final int SEQ_END_CODE
See Also:
Constant Field Values

SEQ_START_CODE

private static final int SEQ_START_CODE
See Also:
Constant Field Values

GOP_START_CODE

private static final int GOP_START_CODE
See Also:
Constant Field Values

PICTURE_START_CODE

private static final int PICTURE_START_CODE
See Also:
Constant Field Values

SLICE_MIN_START_CODE

private static final int SLICE_MIN_START_CODE
See Also:
Constant Field Values

SLICE_MAX_START_CODE

private static final int SLICE_MAX_START_CODE
See Also:
Constant Field Values

EXT_START_CODE

private static final int EXT_START_CODE
See Also:
Constant Field Values

USER_START_CODE

private static final int USER_START_CODE
See Also:
Constant Field Values

I_TYPE

private static final int I_TYPE
See Also:
Constant Field Values

P_TYPE

private static final int P_TYPE
See Also:
Constant Field Values

B_TYPE

private static final int B_TYPE
See Also:
Constant Field Values
Constructor Detail

MPEGStillEncoder

public MPEGStillEncoder()
Method Detail

encode

public void encode(java.awt.image.BufferedImage bImage,
                   boolean isNtsc,
                   java.io.OutputStream outputStream,
                   int qscale,
                   boolean multiplex,
                   int std_buffer_size,
                   int vbv_buffer_size)
            throws java.io.IOException,
                   java.lang.IllegalArgumentException

writeMiddlePack

private void writeMiddlePack(MPEGStillEncoder.EncodingEnv ee,
                             int clock,
                             int length)
                      throws java.io.IOException

writePackHeader

private void writePackHeader(MPEGStillEncoder.EncodingEnv ee,
                             int clock)
                      throws java.io.IOException

writeSystemHeader

private void writeSystemHeader(MPEGStillEncoder.EncodingEnv ee)
                        throws java.io.IOException

writePadding

private void writePadding(MPEGStillEncoder.EncodingEnv ee,
                          int paddingLength)
                   throws java.io.IOException

writeVideoPacket

private void writeVideoPacket(MPEGStillEncoder.EncodingEnv ee,
                              int length,
                              int pts,
                              int dts)
                       throws java.io.IOException

produceVideoStream

private void produceVideoStream(MPEGStillEncoder.EncodingEnv ee)
                         throws java.io.IOException

writeMacroblock

private void writeMacroblock(MPEGStillEncoder.EncodingEnv ee,
                             MPEGStillEncoder.Macroblock mb,
                             int i,
                             int j)
                      throws java.io.IOException

encodeAC

private void encodeAC(MPEGStillEncoder.EncodingEnv ee,
                      int runlength,
                      int level)
               throws java.io.IOException

encodeDC

private void encodeDC(MPEGStillEncoder.EncodingEnv ee,
                      int dc_diff,
                      int type)
               throws java.io.IOException

quantizeMacroblock

private MPEGStillEncoder.Macroblock quantizeMacroblock(MPEGStillEncoder.EncodingEnv ee,
                                                       MPEGStillEncoder.Macroblock mb)

mpeg1DFDCT

private double mpeg1DFDCT(double[] v,
                          int i,
                          int offset)

c

private double c(int i)

getLum

private double getLum(java.awt.Color c)

getChromU

private double getChromU(java.awt.Color c)

getChromV

private double getChromV(java.awt.Color c)

getMacroblock

private MPEGStillEncoder.Macroblock getMacroblock(java.awt.image.BufferedImage bImage,
                                                  int i,
                                                  int j)

main

public static void main(java.lang.String[] argv)