/* 119 */ if (sm == null) {
/* 120 */ return null;
/* */ }
/* 122 */ int nbands = sm.getNumBands();
/* */
/* 124 */ JPEGParam j2dJP = createDefaultJ2DJPEGEncodeParam(nbands);
/* */
/* 126 */ int[] hSubSamp = (int[])paramList.getObjectParameter("horizontalSubsampling");
/* */
/* 128 */ int[] vSubSamp = (int[])paramList.getObjectParameter("verticalSubsampling");
/* */
/* 130 */ int[] qTabSlot = (int[])paramList.getObjectParameter("quantizationTableMapping");
/* */
/* 133 */ for (int i = 0; i < nbands; i++) {
/* 134 */ j2dJP.setHorizontalSubsampling(i, hSubSamp[i]);
/* 135 */ j2dJP.setVerticalSubsampling(i, vSubSamp[i]);
/* */
/* 137 */ int[] qTab = (int[])paramList.getObjectParameter("quantizationTable" + i);
/* */
/* 139 */ if ((qTab != null) && (qTab.equals(ParameterListDescriptor.NO_PARAMETER_DEFAULT)))
/* */ {
/* 141 */ j2dJP.setQTableComponentMapping(i, qTabSlot[i]);
/* 142 */ j2dJP.setQTable(qTabSlot[i], new JPEGQTable(qTab));
/* */ }
/* */ }
/* */
/* 146 */ if (paramList.getBooleanParameter("qualitySet")) {
/* 147 */ float quality = paramList.getFloatParameter("quality");
/* 148 */ j2dJP.setQuality(quality, true);
/* */ }
/* */
/* 151 */ int rInt = paramList.getIntParameter("restartInterval");
/* 152 */ j2dJP.setRestartInterval(rInt);
/* */
/* 154 */ j2dJP.setImageInfoValid(paramList.getBooleanParameter("writeImageInfo"));
/* 155 */ j2dJP.setTableInfoValid(paramList.getBooleanParameter("writeTableInfo"));
/* */
/* 157 */ if (paramList.getBooleanParameter("writeJFIFHeader")) {
/* 158 */ j2dJP.setMarkerData(224, (byte[][])null);
/* */ }
/* */
/* 161 */ return j2dJP;
/* */ }