Current convolutional neural networks (CNN) have achieved a high inference accuracy by deeper architecture, generating a large amount of interlayer data. Limited to on-chip memory, massive feature maps significantly impact the performance of hardware platforms. In this paper, we propose a dynamic codec with adaptive quantization for compressing inlayer feature maps which efficiently reduces the memory storage. Discrete cosine transform (DCT) is utilized to concentrate essential information in the frequency domain while high-frequency components are compressed by adaptive quantization. The quantization tables are dynamically adjusted by the storage of the previous map and the number of the current layer to maintain a relatively high compression ratio and quality for each layer. In addition, Huffman coding and run length encoding (RLE) are used to code compressed data streams from 2-D to 1-D for storage. Furthermore, the codec is implemented on FPGA and synthesized in TSMC 28nm technology. It yields a reduction of on-chip memory by 44.17% and achieves an average compression ratio of 69.18% for feature maps at diverse depths in ResNet-50.