A cod piece is a flap or pouch that attaches to the front of the crotch of men's trousers to provide a covering for the genitals. It would be held closed by laces, buttons, or other methods.
In the 15th and 16th centuries, it was an important item of European clothing.
At first, the codpiece was entirely a practical matter of modesty. In the 14th century, men's hose were two separate legs worn over linen drawers, leaving a man's privy members covered only by a layer of linen. As the century wore on and men's hemlines rose, the hose became longer and joined at the centre back but remained open at the centre front. The shortening of the cote or doublet resulted in under-disguised genitalia, so the codpiece began life as a triangular piece of fabric covering the gap.
As time passed, codpieces were shaped to emphasize the male genitalia and eventually became so much padded as to emphasise rather than to conceal, reaching its extreme of size and decoration in the 1540s before falling out of use by the 1590s.