需要帮助从 libjpeg 编译 jpegtran.c 代码

Need help compiling jpegtran.c code from libjpeg(需要帮助从 libjpeg 编译 jpegtran.c 代码)

本文介绍了需要帮助从 libjpeg 编译 jpegtran.c 代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新见底部

我遇到了一些奇怪的问题.对于初学者,我使用的是最新的 Eclipse CDT,在实现 do_rot_180 之前,编译器链接了文件夹 projectName/include 但之后它现在需要指定特定的 include/*.h下面.

I am running into a number of odd problems. For starters, I'm using the latest Eclipse CDT and before implementing do_rot_180, the compiler linked the folder projectName/include but after it now requires specific include/*.h specified below.

与该问题相关,在项目资源管理器中,似乎认为 libjpeg.h 丢失或无效,尽管它位于磁盘上的文件夹中.

Related to that issue, in the project explorer, it seems to think libjpeg.h is missing or invalid despite it being in the folder on the disk.

我正在使用 libjpeg-9.

I am working with libjpeg-9.

包含(包含 transupp.c 和 example.c 包含的内容):

Includes (included what transupp.c and example.c included):

函数(do_rot_180 来自 transupp.c,read_JPEG_file 来自 example.c):

Functions (do_rot_180 is from transupp.c and read_JPEG_file is from example.c):

See updated code block below under Edit 2 (pretty much just jpegtran.c code)

This is the rotate function which is unused in jpegtran.c:
//LOCAL(void)
    //do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
    //      JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
    //      jvirt_barray_ptr *src_coef_arrays,
    //      jvirt_barray_ptr *dst_coef_arrays)
    ///* 180 degree rotation is equivalent to
    // *   1. Vertical mirroring;
    // *   2. Horizontal mirroring.
    // * These two steps are merged into a single processing routine.
    // */
    //{
    //  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
    //  JDIMENSION x_crop_blocks, y_crop_blocks;
    //  int ci, i, j, offset_y;
    //  JBLOCKARRAY src_buffer, dst_buffer;
    //  JBLOCKROW src_row_ptr, dst_row_ptr;
    //  JCOEFPTR src_ptr, dst_ptr;
    //  jpeg_component_info *compptr;
    //
    //  MCU_cols = srcinfo->output_width /
    //    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
    //  MCU_rows = srcinfo->output_height /
    //    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
    //
    //  for (ci = 0; ci < dstinfo->num_components; ci++) {
    //    compptr = dstinfo->comp_info + ci;
    //    comp_width = MCU_cols * compptr->h_samp_factor;
    //    comp_height = MCU_rows * compptr->v_samp_factor;
    //    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
    //    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
    //    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
    //   dst_blk_y += compptr->v_samp_factor) {
    //      dst_buffer = (*srcinfo->mem->access_virt_barray)
    //  ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
    //   (JDIMENSION) compptr->v_samp_factor, TRUE);
    //      if (y_crop_blocks + dst_blk_y < comp_height) {
    //  /* Row is within the vertically mirrorable area. */
    //  src_buffer = (*srcinfo->mem->access_virt_barray)
    //    ((j_common_ptr) srcinfo, src_coef_arrays[ci],
    //     comp_height - y_crop_blocks - dst_blk_y -
    //     (JDIMENSION) compptr->v_samp_factor,
    //     (JDIMENSION) compptr->v_samp_factor, FALSE);
    //      } else {
    //  /* Bottom-edge rows are only mirrored horizontally. */
    //  src_buffer = (*srcinfo->mem->access_virt_barray)
    //    ((j_common_ptr) srcinfo, src_coef_arrays[ci],
    //     dst_blk_y + y_crop_blocks,
    //     (JDIMENSION) compptr->v_samp_factor, FALSE);
    //      }
    //      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
    //  dst_row_ptr = dst_buffer[offset_y];
    //  if (y_crop_blocks + dst_blk_y < comp_height) {
    //    /* Row is within the mirrorable area. */
    //    src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
    //    for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
    //      dst_ptr = dst_row_ptr[dst_blk_x];
    //      if (x_crop_blocks + dst_blk_x < comp_width) {
    //        /* Process the blocks that can be mirrored both ways. */
    //        src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
    //        for (i = 0; i < DCTSIZE; i += 2) {
    //      /* For even row, negate every odd column. */
    //      for (j = 0; j < DCTSIZE; j += 2) {
    //        *dst_ptr++ = *src_ptr++;
    //        *dst_ptr++ = - *src_ptr++;
    //      }
    //      /* For odd row, negate every even column. */
    //      for (j = 0; j < DCTSIZE; j += 2) {
    //        *dst_ptr++ = - *src_ptr++;
    //        *dst_ptr++ = *src_ptr++;
    //      }
    //        }
    //      } else {
    //        /* Any remaining right-edge blocks are only mirrored vertically. */
    //        src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x];
    //        for (i = 0; i < DCTSIZE; i += 2) {
    //      for (j = 0; j < DCTSIZE; j++)
    //        *dst_ptr++ = *src_ptr++;
    //      for (j = 0; j < DCTSIZE; j++)
    //        *dst_ptr++ = - *src_ptr++;
    //        }
    //      }
    //    }
    //  } else {
    //    /* Remaining rows are just mirrored horizontally. */
    //    src_row_ptr = src_buffer[offset_y];
    //    for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
    //      if (x_crop_blocks + dst_blk_x < comp_width) {
    //        /* Process the blocks that can be mirrored. */
    //        dst_ptr = dst_row_ptr[dst_blk_x];
    //        src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
    //        for (i = 0; i < DCTSIZE2; i += 2) {
    //      *dst_ptr++ = *src_ptr++;
    //      *dst_ptr++ = - *src_ptr++;
    //        }
    //      } else {
    //        /* Any remaining right-edge blocks are only copied. */
    //        jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
    //                dst_row_ptr + dst_blk_x,
    //                (JDIMENSION) 1);
    //      }
    //    }
    //  }
    //      }
    //    }
    //  }
    /

本文标题为:需要帮助从 libjpeg 编译 jpegtran.c 代码

基础教程推荐