📄 qccvidrdwtblockencode.3
字号:
.TH QCCVIDRDWTBLOCKENCODE 1 "QCCPACK" "".SH NAMEQccVIDRDWTBlockEncode, QccVIDRDWTBlockDecode \-encode/decode an image sequence using the RDWT-block algorithm.SH SYNOPSIS.B #include "libQccPack.h".sp.BI "int QccVIDRDWTBlockEncode(QccIMGImageSequence *" image_sequence ", const QccFilter *" filter1 ", const QccFilter *" filter2 ", const QccFilter *" filter3 ", int " subpixel_accuracy ", QccBitBuffer *" output_buffer ", int " blocksize ", int " num_levels ", int " target_bit_cnt ", const QccWAVWavelet *" wavelet ", const QccString " mv_filename ", int " read_motion_vectors ", int " quiet );.sp.BI "int QccVIDRDWTBlockDecodeHeader(QccBitBuffer *" input_buffer ", int *" num_rows ", int *" num_cols ", int *" start_frame_num ", int *" end_frame_num ", int *" blocksize ", int *" num_levels ", int *" target_bit_cnt );.sp.BI "int QccVIDRDWTBlockDecode(QccIMGImageSequence *" image_sequence ", const QccFilter *" filter1 ", const QccFilter *" filter2 ", const QccFilter *" filter3 ", int " subpixel_accuracy ", QccBitBuffer *" input_buffer ", int " target_bit_cnt ", int " blocksize ", int " num_levels ", const QccWAVWavelet *" wavelet ", const QccString " mv_filename ", int " quiet );.SH DESCRIPTION.SS Encoding.LP.B QccVIDRDWTBlockEncode()encodes an.I image_sequenceusing the RDWT-block video-coding algorithm by Park and Kim.Essentially, the RDWT-block algorithm involves traditionalblock-based motion estimation and motion compensation whereinthe redundant phases of the RDWT of the reference frame are usedto circumvent the shift variance of the wavelet transform; see "ALGORITHM"below for greater detail..LP.I image_sequenceis the image sequence to be coded andshould indicate a collection of grayscale images of the same size storedas separate, numbered files; thefilename indicated by.I image_sequencemust contain one .BR printf (3)-stylenumerical descriptor which will then be filled in the currentframe number (e.g., football.%03d.pgm will becomefootball.000.pgm, football.001.pgm, etc.; see.BR QccPackIMG (3)).Each frame of.I image_sequencemust have a size which is an integer multiple of.I blocksizeboth horizontally and vertically.Both the.I start_frame_numand.I end_frame_numfields of.I image_sequenceshould indicate the desired starting and stopping frames, respectively,for the encoding;these should either be set manually or via a call to.BR QccIMGImageSequenceFindFrameNums (3)prior to calling.BR QccVIDRDWTBlockEncode() ..LP.IR filter1 ,.IR filter2 ,and.IR filter3 are interpolation filters for supporting the subpixel accuracy specified by.IR subpixel_accuracywhich can be one of.BR QCCVID_ME_FULLPIXEL ,.BR QCCVID_ME_HALFPIXEL ,.BR QCCVID_ME_QUARTERPIXEL ,or .BR QCCVID_ME_EIGHTHPIXEL ,indicating full-, half-, quarter-, or eighth-pixel accuracy, respectively.See "SUBPIXEL ACCURACY" below..LP.I output_bufferis the output bitstreamwhich must be of.B QCCBITBUFFER_OUTPUTtype and opened via a prior call to.BR QccBitBufferStart (3)..LP.I num_levelsgives the number of levels of dyadic wavelet decomposition to perform,and.I waveletis the wavelet to use for decomposition..LPWhen encoding the current frame,.BR QccVIDRDWTBlockEncode()will first output to.IR output_bufferall the motion vectors for the frame, and thenan embedded intraframe encoding of the motion-compensated residual..I target_bit_cntis the desired number of bits to output for each frame,including motion vectors and motion-compensated residual.After.I target_num_bitshave been produced for the current frame,.BR QccVIDRDWTBlockEncode()will call.BR QccBitBufferFlush (3)to flush the bit-buffer contents to the output bitstream.Encoding of the next frame starts on the next byte boundaryof the output bitstream..LP.I mv_filenamegives the filename for files of motion vectors.If.I read_motion_vectorsis.BR FALSE ,then the motion-vectors are written to.I mv_filenamevia.BR QccVIDMotionVectorsWriteFile (3)..I mv_filenameshould have a.BR printf (3)-stylenumerical descriptor which will then be filled in withthe current frame number before writing, so that motion vectorsare separated into multiple files, one file per frame.On the other hand, if.I read_motion_vectorsis.BR TRUE ,then motion vectors are read from.IR mv_filenamevia.BR QccVIDMotionVectorsReadFile (3),in which case.BR QccVIDRDWTBlockEncode()performs no motion estimation itself, using simply themotion vectors read from the files for coding..LPIf.IR quiet = 0,.BR QccVIDRDWTBlockEncode()will print to stdout a number of statistics concerning each frame as itis encoding.If.I quiet= 1,this verbose output is suppressed..SS Decoding.BR QccVIDRDWTBlockDecodeHeader()decodes the header information in a bitstream produced by.BR QccVIDRDWTBlockEncode() .The input bitstream is.I input_bufferwhich must be of.I QCCBITBUFFER_INPUTtype and open via a prior call to.BR QccBitBufferStart (3).The header information is returned in.I num_rows(vertical size of image-sequence frames),.I num_cols(horizontal size of image-sequence frames),.I start_frame_num(number of the first frame of the sequence),.I end_frame_num(number of the last frame of the sequence),.I num_levels(number of wavelet-transform levels),and.I target_bit_cnt(number of bits encoded for each frame)..LP.B QccVIDRDWTBlockDecode()decodes the bitstream.IR input_buffer ,reconstructing each image of the output image sequence and writing itto a separate, numbered grayscale-image file.The filename denoted by.IR image_sequencemust contain one.BR printf (3)-stylenumerical descriptor which is filled in with the number of the currentframe being decoded.The bitstream must already have had its header read by a prior call to.BR QccVIDRDWTBlockDecodeHeader()(i.e., you call.BR QccVIDRDWTBlockDecodeHeader()first and then.BR QccVIDRDWTBlockDecode() ).If.IR quiet= 0, then.BR QccVIDRDWTBlockDecode()prints a brief message to stdout after decoding each frame; if.IR quiet= 1, then this message is suppressed..LP.IR filter1 ,.IR filter2 ,and.IR filter3 are interpolation filters for supporting the subpixel accuracy specified by.IR subpixel_accuracywhich can be one of.BR QCCVID_ME_FULLPIXEL ,.BR QCCVID_ME_HALFPIXEL ,.BR QCCVID_ME_QUARTERPIXEL ,or .BR QCCVID_ME_EIGHTHPIXEL ,indicating full-, half-, quarter-, or eighth-pixel accuracy, respectively.See "SUBPIXEL ACCURACY" below..LP.I mv_filenamegives the name of files of motion vectors.If.I mv_filenameis.BR NULL ,then.BR QccVIDRDWTBlockDecode()simply decodes the motion vectors to use in decoding from the bitstream(the usual state of affairs).On the other hand, if.IR mv_filenameis not.BR NULL ,then the motion vectors stored in the bitstream are ignored and, rather,the motion vectors are read from.I mv_filenameinstead..I mv_filenameshould have a.BR printf (3)-stylenumerical descriptor which will then be filled in withthe current frame number before reading via.BR QccVIDMotionVectorsReadFile (3)..SH "ALGORITHM"In recent years, there have been proposeda number of video codersthat use the RDWT to circumventthe shift variance of traditional critically sampled wavelet transforms,a trait which has long hinder deployment ofmotion estimation and compensation in the DWT domain.The majority of prior work concerningRDWT-based video coding originates in thework of Park and Kim who proposed the RDWT-blockcoder implemented here.In essence, the RDWT-block coder works as follows.An input frame is decomposed with a critically sampledDWT via.BR QccWAVSubbandPyramidDWT (3)and partitioned into blocks wherein each.IR N x Nblock.RI ( N= .IR blocksize )for is composedof the coefficients from each subband that correspond spatially toa particular.IR N x Nblock in the original image.A full-search block-matching algorithm is then used tocompute motion vectors for each wavelet-domain block; the system uses as thereference for this search an RDWT decompositionof the previousreconstructed frame,generated by.BR QccWAVWaveletRedundantDWT2D (3).The motion-estimation procedure of the coder amountsto identifying, for each block of the current frame, a particularcritically sampledDWT in the RDWT, and a displacementwithin that DWT(see .BR QccWAVWaveletRedundantDWT2DSubsample (3)).Transmission of a single motion vectorper block suffices to convey this all of this motioninformation to the decoder..LPAfter creating the motion-compensated residual in the criticallysampled DWT domain, the RDWT-block coder then performs intraframe codingof the residual. Although it is possible to use any wavelet-domaincoder for this task, Park and Kim used the embedded SPIHT coder as theintraframe coder. The QccPack implementationof the RDWT-block coder does the same via a call to.BR QccSPIHTEncode2 (3)on the DWT-domain motion-compensated residual..LPThe coder developed by Park and Kim has often been calledthe "low-band shift" (LBS) method due to theirproposal for implementing the RDWT via a sequence ofone-sample shifts and filter banks. However,"low-band shift" is just one of several equivalent waysof implementing the RDWT (the original.I algorithme a trousbeing another; see.BR QccWAVWaveletRedundantDWT2D (3)).Consequently, we refer to Park and Kim's method as "RDWT block"to emphasize its use of traditional block-based motion estimationand compensation, albeit in the RDWT domain, and to distinguish itfrom other RDWT-based techniques employing significantlydifferent coder architectures..SH "SUBPIXEL ACCURACY"As described originally by Park and Kim,the RDWT-block algorithm uses motion estimation and compensation withfull, integer-pixel accuracy. However, due to the linearity of the RDWT,it is possible to implement subpixel interpolation in the RDWT domain ina manner similar to as done in the spatial domain to support traditionalsubpixel accuracy. Specifically, one simply interpolates each subband of the RDWT to subpixelaccuracy independently..BR QccVIDRDWTBlockEncode()and.BR QccVIDRDWTBlockDecode()both call.BR QccVIDMotionEstimationCreateReferenceFrame (3)for each subband of the RDWT of the reference frame to interpolate the subbandto the accuracy specified by.IR subpixel_accuracy .The filters.IR filter1 ,.IR filter2 ,and.IR filter3are passed to.BR QccVIDMotionEstimationCreateReferenceFrame (3)to control whether filtered interpolation or bilinear interpolationis performed at each step of the subpixel interpolation.See.BR QccVIDMotionEstimationCreateReferenceFrame (3)for more detail..SH "SEE ALSO".BR rdwtblockencode (1),.BR rdwtblockdecode (1),.BR QccWAVWaveletRedundantDWT2D (3),.BR QccWAVWaveletRedundantDWT2D (3),.BR QccVIDMotionVectorsReadFile (3),.BR QccVIDMotionVectorsWriteFile (3),.BR QccVIDMotionEstimationCreateReferenceFrame (3),.BR QccSPIHTEncode2 (3),.BR QccPackVID (3),.BR QccPackSPIHT (3),.BR QccPackWAV (3),.BR QccPackIMG (3),.BR QccPack (3)H.-W. Park and H.-S. Kim,"Motion Estimation Using Lowband-Shift Method forWavelet-Based Moving-Picture Coding,".IR "IEEE Transactions on Image Processing" ,vol. 9, no. 4, pp. 577-587, April 2000..SH AUTHORWritten by Joe Boettcher <jbb15@msstate.edu> based onthe originally developed algorithm and code by Suxia Cui.Copyright (C) 1997-2007 James E. Fowler.\" The programs herein are free software; you can redistribute them and/or.\" modify them under the terms of the GNU General Public License.\" as published by the Free Software Foundation; either version 2.\" of the License, or (at your option) any later version..\" .\" These programs are distributed in the hope that they will be useful,.\" but WITHOUT ANY WARRANTY; without even the implied warranty of.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the.\" GNU General Public License for more details..\" .\" You should have received a copy of the GNU General Public License.\" along with these programs; if not, write to the Free Software.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -