jsjpeg.js
/**
 * Read and decode the DC coefficient from the bit stream. Side effect is that it loads the 
 * 
 * Returns the DC coefficient
 * 
 * F.2.2.1
 * 
 * @param {DataViewReader} reader Data source
 * @param {*} img Struct containing information about the image
 * @param {*} scan Struct containing information about the scan (specifically the table of DC predictors)
 * @param {*} id ID of the current component. Used to look up the current DC predictor
 * @param {*} dcTable Huffman table implementation for DC coefficients
 */
Read and decode the DC coefficient from the bit stream. Side effect is that it loads the

Returns the DC coefficient



@param {DataViewReader} reader Data source
@param {*} img Struct containing information about the image
@param {*} scan Struct containing information about the scan (specifically the table of DC predictors)
@param {*} id ID of the current component. Used to look up the current DC predictor
@param {*} dcTable Huffman table implementation for DC coefficients
Read and decode the DC coefficient from the bit stream . Side effect is that it loads the Returns the DC coefficient @param { DataViewReader } reader Data source @param { * } img Struct containing information about the image @param { * } scan Struct containing information about the scan ( specifically the table of DC predictors ) @param { * } id ID of the current component . Used to look up the current DC predictor @param { * } dcTable Huffman table implementation for DC coefficients
function decodeDCCoeff(reader, img, scan, id, dcTable) {
    let t = dcTable.decodeHuffman(reader, img);
    let diff = receive(reader, img, t);
    diff = extend(diff, t);
    let dcpred = scan.dcpred[id];
    return dcpred + diff;
}
function decodeDCCoeff ( reader , img , scan , id , dcTable ) { let t = dcTable . decodeHuffman ( reader , img ) ; let diff = receive ( reader , img , t ) ; diff = extend ( diff , t ) ; let dcpred = scan . dcpred [ id ] ; return dcpred + diff ; }
Read and decode the DC coefficient from the bit stream.
Read and decode the DC coefficient from the bit stream .
// console.log("DC Coeff: val: " + t + ", diff: " + diff + ", pred: " + dcpred);